commit 7ccb19fb6fe108cbd80061fe6265fd44948ae144 Author: asnev Date: Fri Jun 12 07:54:22 2026 +0700 genesis diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dfb93ed --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.directory +*.swp diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f12af43 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 asnev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..1f1abf4 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +``` +. +├── configuration.nix +├── flake.lock +├── flake.nix +├── hosts +│   └── phostron +│   ├── default.nix +│   └── hardware.nix +├── LICENSE +├── profiles +│   └── kde.nix +├── README.md +└── users + └── coyote + ├── default.nix + └── home.nix + +6 directories, 10 files +``` diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..5276882 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,159 @@ +{pkgs, ...}: { + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 10; + }; + efi.canTouchEfiVariables = true; + timeout = 2; + }; + kernelParams = [ + "quiet" + "rd.udev.log_level=3" + "rd.systemd.show_status=auto" + ]; + initrd.verbose = false; + consoleLogLevel = 3; + kernelPackages = pkgs.linuxPackages_latest; + }; + + time.timeZone = "Asia/Jakarta"; + i18n.defaultLocale = "en_GB.UTF-8"; + + services = { + fwupd.enable = true; + xserver.xkb.layout = "us"; + locate.enable = true; + printing.enable = true; + openssh.enable = false; + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + }; + + security = {rtkit.enable = true;}; + + nix = { + settings = { + experimental-features = ["nix-command" "flakes"]; + auto-optimise-store = true; + }; + }; + + nixpkgs = {config.allowUnfree = true;}; + + environment = { + systemPackages = with pkgs; [ + # Nix + nh + alejandra + # system utils + firmware-updater + mtr + gnupg + ddate + testdisk + tree + wget + btop + dysk + plocate + traceroute + # extra utils + fd + bat + xh + zellij + tlrc + #gitui + lazygit + dust + hyperfine + ripgrep + fzf + # "fun" utils + lolcat + cowsay + fortune-kind + # programming + pulsar + nil + marksman + clojure-lsp + lua-language-server + systemd-lsp + bash-language-server + ]; + }; + + programs = { + fish.enable = true; + nix-ld = { + enable = true; + libraries = with pkgs; [ + fuse + e2fsprogs + ]; + }; + starship = { + enable = true; + transientPrompt = { + enable = true; + right = "starship module time"; + }; + settings = { + "$schema" = "https://starship.rs/config-schema.json"; + "git_status" = { + ahead = ">"; + behind = "<"; + diverged = "<>"; + renamed = "r"; + deleted = "x"; + }; + }; + }; + foot = { + enable = true; + settings = { + scrollback.lines = 100000; + main.initial-window-size-chars = "80x24"; + }; + }; + atuin = { + enable = true; + settings.sync_address = "https://api.atuin.sh"; + }; + }; + + fonts = { + packages = with pkgs; [ + # GUI fonts + inter + corefonts + vista-fonts + roboto + cantarell-fonts + # fonts for i18n + noto-fonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + noto-fonts-color-emoji + noto-fonts-monochrome-emoji + unifont + unifont_upper + unifont-csur + # monospace fonts + iosevka + nerd-fonts.iosevka + ]; + fontconfig = { + antialias = true; + subpixel.rgba = "rgb"; + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c68ebc2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,49 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781184346, + "narHash": "sha256-cZRlW47U6A2nWvAmnZeeO6Xvq23gxYbVLel4KxqOrcQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ea6d221d7aa85652d014b6f719dddf036037515b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-26.05", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1780902259, + "narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ac5a5f0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + description = "asnev's NixOS configuration"; + + inputs = { + nixpkgs = { + url = "github:nixos/nixpkgs/nixos-26.05"; + }; + #nixpkgs-unstable = { + # url = "github:nixos/nixpkgs/nixos-unstable"; + #}; + home-manager = { + url = "github:nix-community/home-manager/release-26.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs @ { + self, + nixpkgs, + #nixpkgs-unstable, + home-manager, + ... + }: let + system = "x86_64-linux"; + #pkgs-unstable = import nixpkgs-unstable {inherit system;}; + in { + nixosConfigurations = { + phostron = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = {inherit inputs;}; + modules = [ + ./configuration.nix + ./hosts/phostron/default.nix + ./users/coyote/default.nix + ./profiles/kde.nix + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = {inherit inputs;}; + users.coyote = ./users/coyote/home.nix; + }; + } + ]; + }; + }; + }; +} diff --git a/hosts/phostron/default.nix b/hosts/phostron/default.nix new file mode 100644 index 0000000..e693f65 --- /dev/null +++ b/hosts/phostron/default.nix @@ -0,0 +1,28 @@ +{pkgs, ...}: { + imports = [ + ./hardware.nix + ../../configuration.nix + ]; + + system.stateVersion = "26.05"; # I hope you know what you're doing. :) + + services.displayManager.sddm.settings = { + Theme = { + Font = "Inter"; + CursorSize = 18; + }; + }; + + hardware = { + bluetooth = { + enable = true; + powerOnBoot = false; + }; + }; + + networking = { + hostName = "phostron"; + networkmanager.enable = true; + firewall.enable = true; + }; +} diff --git a/hosts/phostron/hardware.nix b/hosts/phostron/hardware.nix new file mode 100644 index 0000000..a6df3a0 --- /dev/null +++ b/hosts/phostron/hardware.nix @@ -0,0 +1,37 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = ["nvme" "ehci_pci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/24fb172c-c29f-40c3-ae4d-ff652358563a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/DFC9-994A"; + fsType = "vfat"; + options = ["fmask=0077" "dmask=0077"]; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/91d96247-85c3-4e0a-93a2-5632b96179b6";} + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/profiles/kde.nix b/profiles/kde.nix new file mode 100644 index 0000000..6618397 --- /dev/null +++ b/profiles/kde.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + services = { + displayManager.sddm.enable = true; + desktopManager.plasma6.enable = true; + }; + + environment = { + systemPackages = with pkgs; [ + kdePackages.kate + kdePackages.bluez-qt + kdePackages.kalk + kdePackages.filelight + kdePackages.kamoso + ]; + plasma6.excludePackages = with pkgs; [kdePackages.discover]; + }; +} diff --git a/users/coyote/default.nix b/users/coyote/default.nix new file mode 100644 index 0000000..9550f80 --- /dev/null +++ b/users/coyote/default.nix @@ -0,0 +1,48 @@ +{pkgs, config, ...}: +let + USER_ID = 1000; + KEY_FILE = "id_ed25519"; +in +{ + users = { + users.coyote = { + isNormalUser = true; + description = "coyote"; + extraGroups = ["wheel" "networkmanager"]; + uid = USER_ID; + }; + defaultUserShell = pkgs.fish; + }; + + # packages direcly within system environment + environment = { + systemPackages = with pkgs; [ + ardour + lsp-plugins + steam + ]; + sessionVariables.SSH_AUTH_SOCK = "/run/user/${builtins.toString USER_ID}/ssh-agent"; + }; + + programs = { + foot = { + settings.main.font = "Iosevka Nerd Font Mono:size"; + theme = "gruvbox"; + }; + ssh.startAgent = true; + }; + + systemd.user.services.ssh-add-key = { + wantedBy = ["default.target"]; + after = ["ssh-agent.service"]; + serviceConfig = { + Type = "oneshot"; + ExecStartPre = "${pkgs.coreutils-full}/bin/sleep 1"; + ExecStart = [ + "${pkgs.openssh}/bin/ssh-add ${config.users.users.coyote.home}/.ssh/${KEY_FILE}" + ]; + Restart = "on-failure"; + RestartSec = 1; + }; + }; +} diff --git a/users/coyote/home.nix b/users/coyote/home.nix new file mode 100644 index 0000000..e2b74b8 --- /dev/null +++ b/users/coyote/home.nix @@ -0,0 +1,166 @@ +{pkgs, ...}: { + home = { + stateVersion = "26.05"; # I hope you know what you're doing. :) + + username = "coyote"; + homeDirectory = "/home/coyote"; + shell.enableShellIntegration = true; + packages = with pkgs; [ + # productivity + libreoffice + karp + keepassxc + # multimedia + audacity + obs-studio + furnace + corrscope + vlc + haruna + kdePackages.kdenlive + subtitlecomposer + kid3 + # emulation + (bottles.override {removeWarningPopup = true;}) + # Internet + ungoogled-chromium + # games + osu-lazer-bin + ]; + }; + + programs = { + helix = { + enable = true; + package = pkgs.evil-helix; + defaultEditor = true; + settings = { + editor = { + evil = true; + indent-guides = { + render = true; + skip-levels = 1; + }; + soft-wrap.enable = true; + line-number = "relative"; + lsp.display-messages = true; + }; + theme = "gruvbox"; + }; + }; + fastfetch = { + enable = true; + # config taken from examples/13.jsonc + settings = { + "$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"; + logo = { + type = "small"; + padding = { + top = 4; + left = 3; + right = 4; + }; + }; + display = {separator = " ";}; + modules = [ + { + key = "╭───────────╮"; + type = "custom"; + } + { + key = "│ {#31} user {#keys}│"; + type = "title"; + format = "{user-name}"; + } + { + key = "│ {#32}󰇅 host {#keys}│"; + type = "title"; + format = "{host-name}"; + } + { + key = "│ {#33}󰅐 uptime {#keys}│"; + type = "uptime"; + } + { + key = "│ {#34}{icon} distro {#keys}│"; + type = "os"; + } + { + key = "│ {#35} kernel {#keys}│"; + type = "kernel"; + } + { + key = "│ {#36}󰇄 desktop {#keys}│"; + type = "de"; + } + { + key = "│ {#31} term {#keys}│"; + type = "terminal"; + } + { + key = "│ {#32} shell {#keys}│"; + type = "shell"; + } + { + key = "│ {#33}󰍛 cpu {#keys}│"; + type = "cpu"; + showPeCoreCount = true; + } + { + key = "│ {#34}󰉉 disk {#keys}│"; + type = "disk"; + folders = "/"; + } + { + key = "│ {#35} memory {#keys}│"; + type = "memory"; + } + { + key = "│ {#36}󰩟 network {#keys}│"; + type = "localip"; + format = "{ipv4} ({ifname})"; + } + { + key = "├───────────┤"; + type = "custom"; + } + { + key = "│ {#39} colors {#keys}│"; + type = "colors"; + symbol = "circle"; + } + { + key = "╰───────────╯"; + type = "custom"; + } + ]; + }; + }; + git = { + enable = true; + settings = { + init.defaultBranch = "main"; + advice.defaultBranchName = false; + gpg.format = "ssh"; + commit.gpgSign = true; + }; + }; + librewolf = { + enable = true; + languagePacks = ["en-GB"]; + settings = { + "privacy.resistFingerprinting" = false; + "librewolf.webgl.prompt" = false; + "identity.fxaccounts.enabled" = true; + "middlemouse.paste" = false; + "general.autoScroll" = true; + "browser.discovery.containers.enabled" = false; + }; + }; + yt-dlp = { + enable = true; + extraConfig = ""; + settings = {}; + }; + }; +}