diff --git a/.gitignore b/.gitignore index 48e8156..2b00143 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ *.swp result result-* - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index fb9cac9..0000000 --- a/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 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 b/README new file mode 100644 index 0000000..2ee8238 --- /dev/null +++ b/README @@ -0,0 +1,3 @@ +`chitin' is asnev's simple, flake-enabled NixOS configuration. + +See `flake.nix' for general information & licensing. diff --git a/README.md b/README.md deleted file mode 100644 index 1eef680..0000000 --- a/README.md +++ /dev/null @@ -1,42 +0,0 @@ -![Banner image. Photographic snippet showing foliage of green moss accompanied by a few small, frail, white mushrooms, resembling umbrellas for tiny people residing within the dew-dripped leaves.](assets/cover.jpg "banner image") - -# chitin - -asnev's [NixOS](https://nixos.org/) configuration - - -## paradigm - -uses [flake-parts](https://flake.parts/)' in-built modules system for less schema boilerplate, though shared infra-wide values (available via the `systemConstants` attrs argument) are configured in generic Nix so as to work across all modules, not just top-level ones. - - -## graphics - -only KDE Plasma has been set up so far. (TODO: declaratively configure with [plasma-manager](https://github.com/nix-community/plasma-manager)) - - -## tree - -* `assets/` - media and binary assets -* `modules/` - flake modules (auto-imported with [import-tree](https://github.com/denful/import-tree)) - * `flake/` - infra-related Nix flake logic - * `nixos/` - NixOS configurations that apply to all hosts and users - * `programs/` - system-wide packages and programs - * `home/` - user environment management via [Home Manager](https://github.com/nix-community/home-manager) (installed as a NixOS module) - * `hosts/` - per-host specific configuration - * `packages/` - additional package overlays - * `shells/` - TUI niceties (maybe `devshells` too?) - - -## musings - -* "why `chitin`? why give your configuration files a name at all?" - * because it's fun. and i wanted to use a distantly related web-like word for it. my affinity for fungi made me randomly one day decide that i'd name it after [chitin](https://en.wikipedia.org/wiki/Chitin), the primary molecule giving strength to mycelium networks. -* "did an AI help write-" - * [No](https://www.sheeeeeeeep.art/software-in-current-era.html). - - -## licences - -[MIT Licence](LICENSE) for the code, [Unsplash Licence](https://unsplash.com/license) for the banner image, courtesy of [iamateapot](https://unsplash.com/photos/a-mushroom-growing-in-a-forest-CRHNiHXXFIs) with edits from me. - diff --git a/assets/cover.jpg b/assets/cover.jpg deleted file mode 100644 index 33cf45e..0000000 Binary files a/assets/cover.jpg and /dev/null differ diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..a2950b9 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,246 @@ +## configuration.nix --- common NixOS configuration module ## + +/* + Help is available in the configuration.nix(5) man page, on + https://search.nixos.org/options and in the NixOS manual (`nixos-help'). +*/ + +{ inputs, pkgs, ... }: + +{ + # ----- Module imports ----- # + imports = [ + ./hardware-configuration.nix + ]; + + + # ----- Nix ----- # + nix = { + optimise.automatic = true; + + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + }; + + + # ----- nixpkgs ----- # + nixpkgs = { + config.allowUnfree = true; + + overlays = [ + # `pkgs.unstable.' overlay + (final: prev: { + unstable = import inputs.unstable { + inherit (final) config; + inherit (final.stdenv.hostPlatform) system; + }; + }) + ]; + }; + + + # ----- Boot ----- # + boot = { + kernelPackages = pkgs.linuxPackages_latest; + + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + timeout = 2; + }; + }; + + + # ----- Hardware ----- # + hardware = { + bluetooth.enable = true; + + sane.enable = true; + sane.extraBackends = [ pkgs.epsonscan2 ]; + + graphics.enable = true; + graphics.enable32Bit = true; + enableRedistributableFirmware = true; + }; + + + # ----- Networking ----- # + networking = { + networkmanager.enable = true; + firewall.enable = true; + }; + + + # ----- Locale ----- # + time.timeZone = "Asia/Jakarta"; + i18n.defaultLocale = "en_GB.UTF-8"; + console.font = "Lat2-Terminus16"; + console.useXkbConfig = true; + + + # ----- Services ----- # + services = { + xserver.enable = true; + xserver.xkb.layout = "us"; + + libinput.enable = true; # additional touchpad support + + printing.enable = true; + printing.drivers = [ pkgs.epson-escpr ]; + + fwupd.enable = true; + locate.enable = true; + openssh.enable = false; + + # Audio ----- + pipewire.enable = true; + pipewire = { + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + }; + + + # ----- Security ----- # + security = { + sudo.enable = false; + doas.enable = true; + doas.extraRules = [{ + groups = [ "wheel" ]; + keepEnv = true; + persist = true; + }]; + }; + + + # ----- Environment ----- # + environment = { + # System packages ----- + systemPackages = let + stablePackages = with pkgs; [ + # Utilities + nh wget stow tmux file mc mtr gnupg ddate testdisk tree htop fastfetch + plocate traceroute rlwrap xclip wl-clipboard entr unzip ffmpeg + imagemagick + # Utilities (oxidised) + fd tlrc dysk dust hyperfine fzf + # Utilities (GUI) + firmware-updater pavucontrol gnome-disk-utility + # Development + python315 + ]; + + unstablePackages = with pkgs.unstable; [ + # Text editors + nano vim-classic emacs-nox + # Development + git lazygit + ]; + in stablePackages ++ unstablePackages; + + # System variables ----- + variables = {}; + }; + + + # ----- Fonts ----- # + fonts = { + packages = let + coreFonts = with pkgs; [ cantarell-fonts roboto corefonts ]; + + i18nFonts = with pkgs; [ + noto-fonts noto-fonts-cjk-sans noto-fonts-cjk-serif + noto-fonts-color-emoji noto-fonts-monochrome-emoji + unifont unifont_upper unifont-csur + ]; + + nerdFonts = with pkgs.nerd-fonts; [ iosevka fira-code ]; + in coreFonts ++ i18nFonts ++ nerdFonts; + + fontconfig = { + antialias = true; + subpixel.rgba = "rgb"; + hinting.enable = true; + defaultFonts = { + serif = [ "Noto Serif" ]; + sansSerif = [ "Cantarell" ]; + monospace = [ "Iosevka Nerd Font" ]; + emoji = [ "Noto Color Emoji" ]; + }; + }; + }; + + + # ----- Users ----- # + users = { + mutableUsers = true; + defaultUserShell = pkgs.fish; + + users.coyote = { + description = "coyote"; + isNormalUser = true; + home = "/home/coyote"; + createHome = true; + uid = 1000; + group = "users"; + extraGroups = [ + "wheel" "networkmanager" "lp" "scanner" + "video" "render" "input" "audio" "kvm" + ]; + + # User packages ----- + packages = let + stablePackages = with pkgs; [ + # Productivity + libreoffice-fresh karp keepassxc pdfarranger + # Multimedia + vlc haruna subtitlecomposer kid3 furnace corrscope tenacity + # Editing + kdePackages.kdenlive + # Games + osu-lazer-bin pcsx2 ppsspp + # Wine + (bottles.override {removeWarningPopup = true;}) + ]; + + unstablePackages = with pkgs.unstable; [ + # Internet + vivaldi proton-vpn yt-dlp + ]; + in stablePackages ++ unstablePackages; + }; + }; + + + # ----- System programs ----- # + programs = { + nix-ld = { + enable = true; + libraries = with pkgs; [ fuse e2fsprogs ]; + }; + + fish = { + enable = true; + }; + + direnv = { + enable = true; + nix-direnv.enable = true; + }; + + obs-studio = { + enable = true; + enableVirtualCamera = true; + }; + }; +} +# end of configuration.nix file diff --git a/flake.lock b/flake.lock index d464187..8106691 100644 --- a/flake.lock +++ b/flake.lock @@ -1,125 +1,34 @@ { "nodes": { - "flake-file": { - "locked": { - "lastModified": 1792905615, - "narHash": "sha256-KdGEzlRQPHBbNPD+AChjry8eWEx0TCrGKy1Hkacj+bA=", - "owner": "denful", - "repo": "flake-file", - "rev": "7b08dbc223bb1a758a515aad9653a6bf196bc772", - "type": "github" - }, - "original": { - "owner": "denful", - "repo": "flake-file", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1793576659, - "narHash": "sha256-V1h85lUaJBQoHFrB2vpXZOE0Ju1MYSnIpsehoVZYlDo=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "ea2630b7470978622c7689a1ff75d2b389175399", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1794251182, - "narHash": "sha256-R2sZBXiOJo3HAnvTiVkbbHDJy//JMlAwUKEiPbfqPXk=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "6eb2d33d1d0c95a37ef6443c88e6c1686012ee8b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-26.05", - "repo": "home-manager", - "type": "github" - } - }, - "import-tree": { - "locked": { - "lastModified": 1788467110, - "narHash": "sha256-ljEMTXP/rH0tOvDzc9gzwww6KcHRPRnEHzd9lK48V7s=", - "owner": "vic", - "repo": "import-tree", - "rev": "eb1b52eaecc57f7c136d07ae8a93e724dfecac46", - "type": "github" - }, - "original": { - "owner": "vic", - "repo": "import-tree", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1794552581, - "narHash": "sha256-C0bP9ShRkxihpkAiWel93+JypO7ls9usnHRtK2VLvWA=", - "rev": "f1e5c356f35d07e7b71a6b5e6c9338e0b029e0c0", + "lastModified": 1795258312, + "narHash": "sha256-pLM4uV148b0eRALcfeaBoiw7K2M77XPihI0iNzxytAw=", + "rev": "94c3211b0ee8ba969a3f12eb4aff8ba0f72971dd", "type": "tarball", - "url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.14234.f1e5c356f35d/nixexprs.tar.zst" + "url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.14979.94c3211b0ee8/nixexprs.tar.zst" }, "original": { "type": "tarball", "url": "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1793504054, - "narHash": "sha256-ThkfL3D/FhCiZFc9+3BtxwuMmpuK+/bGtXCSo1+yVew=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "7851ba61fd862b277cb6a9cef37394bc18bb94e4", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 315532800, - "narHash": "sha256-JiTUXdoNJNvdD+fjVlftWiLKJfHut3cIi8j2HXL9kT4=", - "type": "tarball", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1108556.6dadaf4375be/nixexprs.tar.zst" - }, - "original": { - "type": "tarball", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1108556.6dadaf4375be/nixexprs.tar.zst" - } - }, "root": { "inputs": { - "flake-file": "flake-file", - "flake-parts": "flake-parts", - "home-manager": "home-manager", - "import-tree": "import-tree", "nixpkgs": "nixpkgs", - "nixpkgs-lib": [ - "nixpkgs-unstable" - ], - "nixpkgs-unstable": "nixpkgs-unstable" + "unstable": "unstable" + } + }, + "unstable": { + "locked": { + "lastModified": 315532800, + "narHash": "sha256-tFvjrdir1xJuUxdmsv+yK9PiZ4IMnFCeT8z0iayTlso=", + "type": "tarball", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1125912.93a9ed0a8660/nixexprs.tar.zst" + }, + "original": { + "type": "tarball", + "url": "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1125912.93a9ed0a8660/nixexprs.tar.zst" } } }, diff --git a/flake.nix b/flake.nix index ca1d889..1b9e7ad 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,50 @@ -# DO-NOT-EDIT. This file was auto-generated using github:denful/flake-file. -# Use `nix run .#write-flake` to regenerate it. +## flake.nix --- Nix flake entry file ## + +/* + chitin is asnev's simple configuration for a flake-enabled NixOS setup. + + this configuration source code is distributed under the MIT Licence, a copy + of which is included at the end of this flake file. +*/ + { - outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); + description = "chitin"; inputs = { - flake-file.url = "github:denful/flake-file"; - flake-parts.url = "github:hercules-ci/flake-parts"; - home-manager = { - url = "github:nix-community/home-manager/release-26.05"; - inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst"; + unstable.url = "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1125912.93a9ed0a8660/nixexprs.tar.zst"; # last updated: 2026-11-23 07:54 UTC + }; + + outputs = { nixpkgs, ... } @ inputs: { + nixosConfigurations."phostron" = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ ./phostron.nix ]; }; - import-tree.url = "github:vic/import-tree"; - nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst"; - nixpkgs-lib.follows = "nixpkgs-unstable"; - nixpkgs-unstable.url = "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1108556.6dadaf4375be/nixexprs.tar.zst"; }; } + +/* + Copyright (c) 2026 asnev + + MIT Licence + + 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, sublicence, 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. +*/ + +# end of flake.nix file diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 120000 index 0000000..4dde6be --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1 @@ +/etc/nixos/hardware-configuration.nix \ No newline at end of file diff --git a/modules/flake/flake-parts.nix b/modules/flake/flake-parts.nix deleted file mode 100644 index ded8a64..0000000 --- a/modules/flake/flake-parts.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - inputs, - systemConstants, - ... -}: { - flake-file.inputs = { - flake-parts.url = "github:hercules-ci/flake-parts"; - }; - - imports = [ - inputs.flake-parts.flakeModules.modules - inputs.flake-parts.flakeModules.easyOverlay - ]; - - systems = systemConstants.infraSystems; -} diff --git a/modules/flake/fmt.nix b/modules/flake/fmt.nix deleted file mode 100644 index 84c51af..0000000 --- a/modules/flake/fmt.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - perSystem = {pkgs, ...}: { - formatter = pkgs.alejandra; - }; -} diff --git a/modules/flake/write-flake.nix b/modules/flake/write-flake.nix deleted file mode 100644 index e773727..0000000 --- a/modules/flake/write-flake.nix +++ /dev/null @@ -1,12 +0,0 @@ -{inputs, ...}: { - imports = [ - inputs.flake-file.flakeModules.default - ]; - - flake-file.inputs = { - flake-file.url = "github:denful/flake-file"; - import-tree.url = "github:vic/import-tree"; - }; - - flake-file.outputs = "inputs: inputs.flake-parts.lib.mkFlake {inherit inputs;} (inputs.import-tree ./modules)"; -} diff --git a/modules/home/primaryUser/home-packages.nix b/modules/home/primaryUser/home-packages.nix deleted file mode 100644 index e779805..0000000 --- a/modules/home/primaryUser/home-packages.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - flake.modules.homeManager.primaryUser = {pkgs, ...}: { - home.packages = with pkgs; [ - # internet - unstable.vivaldi - proton-vpn - # productivity - libreoffice-fresh - karp - keepassxc - pdfarranger - unstable.emacs - # multimedia - vlc - haruna - subtitlecomposer - kid3 - unstable.yt-dlp - # music - furnace - corrscope - tenacity - # editing - kdePackages.kdenlive - # games - osu-lazer-bin - pcsx2 - ppsspp - # wine - (bottles.override {removeWarningPopup = true;}) - # development - unstable.guile - # misc. - fastfetch - ]; - }; -} diff --git a/modules/home/primaryUser/programs/obs.nix b/modules/home/primaryUser/programs/obs.nix deleted file mode 100644 index d40a14d..0000000 --- a/modules/home/primaryUser/programs/obs.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - flake.modules.homeManager.primaryUser = {pkgs, ...}: { - programs.obs-studio = { - enable = true; - plugins = with pkgs.obs-studio-plugins; [ - input-overlay - droidcam-obs - ]; - }; - }; - - flake.modules.nixos.primaryUser = { - programs.obs-studio.enableVirtualCamera = true; - }; -} diff --git a/modules/hosts/phostron/amd-microcode.nix b/modules/hosts/phostron/amd-microcode.nix deleted file mode 100644 index 389a106..0000000 --- a/modules/hosts/phostron/amd-microcode.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - flake.modules.nixos.phostron = { - config, - lib, - ... - }: { - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - }; -} diff --git a/modules/hosts/phostron/boot.nix b/modules/hosts/phostron/boot.nix deleted file mode 100644 index 86caeb2..0000000 --- a/modules/hosts/phostron/boot.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - flake.modules.nixos.phostron = { - boot = { - initrd = { - availableKernelModules = [ - "nvme" - "ehci_pci" - "xhci_pci" - "usbhid" - "usb_storage" - "sd_mod" - "sdhci_pci" - ]; - - kernelModules = []; - }; - - kernelModules = ["kvm-amd"]; - extraModulePackages = []; - }; - }; -} diff --git a/modules/hosts/phostron/entry.nix b/modules/hosts/phostron/entry.nix deleted file mode 100644 index b428543..0000000 --- a/modules/hosts/phostron/entry.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - inputs, - self, - systemConstants, - ... -}: { - flake.modules.nixos.phostron = {lib, ...}: { - networking.hostName = systemConstants.phostronHostname; - nixpkgs.hostPlatform = lib.mkDefault systemConstants.phostronHostPlatform; - system.stateVersion = systemConstants.phostronStateVersion; - }; - - flake.nixosConfigurations.phostron = inputs.nixpkgs.lib.nixosSystem { - modules = with self.modules.nixos; [ - base - phostron - sddm - kdePlasma - homeManagerModule - - fish - primaryUser - ]; - }; -} diff --git a/modules/hosts/phostron/file-systems.nix b/modules/hosts/phostron/file-systems.nix deleted file mode 100644 index 41838db..0000000 --- a/modules/hosts/phostron/file-systems.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - flake.modules.nixos.phostron = { - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/24fb172c-c29f-40c3-ae4d-ff652358563a"; - fsType = "ext4"; - }; - - "/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";}]; - zramSwap.enable = true; - }; -} diff --git a/modules/hosts/phostron/graphics.nix b/modules/hosts/phostron/graphics.nix deleted file mode 100644 index 2d2c8ce..0000000 --- a/modules/hosts/phostron/graphics.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - flake.modules.nixos.phostron = { - hardware = { - graphics.enable = true; - graphics.enable32Bit = true; - enableRedistributableFirmware = true; - }; - }; -} diff --git a/modules/hosts/phostron/ssd.nix b/modules/hosts/phostron/ssd.nix deleted file mode 100644 index f4b4f45..0000000 --- a/modules/hosts/phostron/ssd.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - flake.modules.nixos.phostron = { - services.fstrim.enable = true; - }; -} diff --git a/modules/nix.nix b/modules/nix.nix deleted file mode 100644 index adb6cd6..0000000 --- a/modules/nix.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - flake.modules.nixos.base = { - nix = { - settings = { - experimental-features = ["nix-command" "flakes"]; - auto-optimise-store = true; - }; - - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 14d"; - }; - - optimise.automatic = true; - }; - }; -} diff --git a/modules/nixos/audio.nix b/modules/nixos/audio.nix deleted file mode 100644 index 55d763d..0000000 --- a/modules/nixos/audio.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - flake.modules.nixos.base = { - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - }; -} diff --git a/modules/nixos/bluetooth.nix b/modules/nixos/bluetooth.nix deleted file mode 100644 index e8d4d96..0000000 --- a/modules/nixos/bluetooth.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - flake.modules.nixos.base = { - hardware.bluetooth.enable = true; - }; -} diff --git a/modules/nixos/boot.nix b/modules/nixos/boot.nix deleted file mode 100644 index 9244d92..0000000 --- a/modules/nixos/boot.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - flake.modules.nixos.base = {pkgs, ...}: { - boot = { - loader = { - systemd-boot = { - enable = true; - configurationLimit = 10; - }; - - efi.canTouchEfiVariables = true; - timeout = 2; - }; - - kernelPackages = pkgs.linuxPackages_latest; - }; - }; -} diff --git a/modules/nixos/configuration.nix b/modules/nixos/configuration.nix deleted file mode 100644 index eaf01d5..0000000 --- a/modules/nixos/configuration.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - flake.modules.nixos.base = {modulesPath, ...}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - }; -} diff --git a/modules/nixos/desktop-manager/kde-plasma.nix b/modules/nixos/desktop-manager/kde-plasma.nix deleted file mode 100644 index fe45acb..0000000 --- a/modules/nixos/desktop-manager/kde-plasma.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - flake.modules.nixos.kdePlasma = {pkgs, ...}: { - services.desktopManager.plasma6.enable = true; - - environment = { - plasma6.excludePackages = with pkgs.kdePackages; [ - discover - ]; - - systemPackages = with pkgs.kdePackages; [ - kate - elisa - bluez-qt - kalk - filelight - kamoso - konversation - kmail - ktorrent - kclock - ]; - }; - }; -} diff --git a/modules/nixos/display-manager/sddm.nix b/modules/nixos/display-manager/sddm.nix deleted file mode 100644 index 5342556..0000000 --- a/modules/nixos/display-manager/sddm.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - flake.modules.nixos.sddm = { - services.displayManager.sddm.enable = true; - }; -} diff --git a/modules/nixos/doas.nix b/modules/nixos/doas.nix deleted file mode 100644 index a2e08ec..0000000 --- a/modules/nixos/doas.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - flake.modules.nixos.base = { - security = { - doas = { - enable = true; - extraRules = [ - { - groups = ["wheel"]; - keepEnv = true; - persist = true; - } - ]; - }; - - sudo.enable = false; - }; - }; -} diff --git a/modules/nixos/fonts.nix b/modules/nixos/fonts.nix deleted file mode 100644 index 61d46e6..0000000 --- a/modules/nixos/fonts.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - flake.modules.nixos.base = {pkgs, ...}: { - fonts = { - packages = with pkgs; [ - # GUI - inter - corefonts - roboto - cantarell-fonts - # internationalisation - noto-fonts - noto-fonts-cjk-sans - noto-fonts-cjk-serif - noto-fonts-color-emoji - noto-fonts-monochrome-emoji - unifont - unifont_upper - unifont-csur - # terminal - nerd-fonts.iosevka - ]; - - fontconfig = { - antialias = true; - subpixel.rgba = "rgb"; - hinting.enable = true; - defaultFonts = { - serif = ["Noto Serif"]; - sansSerif = ["Cantarell"]; - monospace = ["Iosevka Nerd Font"]; - emoji = ["Noto Color Emoji"]; - }; - }; - }; - }; - - flake.modules.nixos.kdePlasma = { - config, - lib, - ... - }: { - services.displayManager.sddm.settings.Theme.Font = - lib.concatStrings config.fonts.fontconfig.defaultFonts.sansSerif; - }; -} diff --git a/modules/nixos/locale.nix b/modules/nixos/locale.nix deleted file mode 100644 index 4d2b12f..0000000 --- a/modules/nixos/locale.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - flake.modules.nixos.base = { - time.timeZone = "Asia/Jakarta"; - i18n.defaultLocale = "en_GB.UTF-8"; - services.xserver.xkb.layout = "us"; - }; -} diff --git a/modules/nixos/modules/home-manager.nix b/modules/nixos/modules/home-manager.nix deleted file mode 100644 index 0be6b9a..0000000 --- a/modules/nixos/modules/home-manager.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - inputs, - systemConstants, - ... -}: { - flake-file.inputs.home-manager = { - url = "github:nix-community/home-manager/release-${systemConstants.homeManagerStateVersion}"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - flake.modules.nixos.homeManagerModule = { - imports = [inputs.home-manager.nixosModules.home-manager]; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - }; - }; -} diff --git a/modules/nixos/networking.nix b/modules/nixos/networking.nix deleted file mode 100644 index a42506a..0000000 --- a/modules/nixos/networking.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - flake.modules.nixos.base = { - networking = { - networkmanager.enable = true; - firewall.enable = true; - }; - }; -} diff --git a/modules/nixos/nix-ld.nix b/modules/nixos/nix-ld.nix deleted file mode 100644 index 5a3cb13..0000000 --- a/modules/nixos/nix-ld.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - flake.modules.nixos.base = {pkgs, ...}: { - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - fuse - e2fsprogs - stdenv.cc.cc - zlib - alsa-lib - expat - ]; - }; - }; -} diff --git a/modules/nixos/printing.nix b/modules/nixos/printing.nix deleted file mode 100644 index 3e5e588..0000000 --- a/modules/nixos/printing.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - flake.modules.nixos.base = {pkgs, ...}: { - services.printing = { - enable = true; - drivers = with pkgs; [ - epson-escpr - ]; - }; - - hardware.sane = { - enable = true; - extraBackends = with pkgs; [ - epsonscan2 - ]; - }; - }; -} diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix deleted file mode 100644 index 1d5172d..0000000 --- a/modules/nixos/services/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - flake.modules.nixos.base = { - services = { - fwupd.enable = true; - locate.enable = true; - openssh.enable = false; - }; - }; -} diff --git a/modules/nixos/system-packages.nix b/modules/nixos/system-packages.nix deleted file mode 100644 index ea65dce..0000000 --- a/modules/nixos/system-packages.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - flake.modules.nixos.base = {pkgs, ...}: { - environment.systemPackages = with pkgs; [ - nh - python315 - stow - git - lazygit - nano - tmux - # system utils - file - mc - firmware-updater - mtr - gnupg - ddate - testdisk - tree - wget - btop - plocate - traceroute - rlwrap - wl-clipboard - entr - unzip - ffmpeg - pavucontrol - imagemagick - gnome-disk-utility - # oxidised utils - fd - bat - xh - tlrc - dysk - dust - hyperfine - ripgrep - fzf - eza - ]; - }; -} diff --git a/modules/nixos/users.nix b/modules/nixos/users.nix deleted file mode 100644 index 9ca335b..0000000 --- a/modules/nixos/users.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - flake.modules.nixos.base = { - users = { - mutableUsers = true; - }; - }; -} diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix deleted file mode 100644 index 22a301c..0000000 --- a/modules/nixpkgs.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - inputs, - systemConstants, - ... -}: let - overlays = systemConstants.nixpkgsOverlays; - config = {allowUnfree = systemConstants.nixpkgsAllowUnfree;}; -in { - flake-file.inputs = { - nixpkgs.url = "https://channels.nixos.org/nixos-${systemConstants.nixpkgsStableVersion}/nixexprs.tar.zst"; - # last updated: 2026-11-06 11:00 UTC - nixpkgs-unstable.url = "https://releases.nixos.org/nixpkgs/nixpkgs-26.11pre1108556.6dadaf4375be/nixexprs.tar.zst"; - nixpkgs-lib.follows = "nixpkgs-unstable"; - }; - - perSystem = {system, ...}: { - _module.args.pkgs = import inputs.nixpkgs {inherit system overlays config;}; - overlayAttrs.unstable = import inputs.nixpkgs-unstable {inherit system config;}; - }; - - flake.modules.nixos.base = { - nixpkgs = {inherit overlays config;}; - }; -} diff --git a/modules/shells/direnv.nix b/modules/shells/direnv.nix deleted file mode 100644 index 8d11f93..0000000 --- a/modules/shells/direnv.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - flake.modules.nixos.base = { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; -} diff --git a/modules/shells/fish.nix b/modules/shells/fish.nix deleted file mode 100644 index 3cd6ae2..0000000 --- a/modules/shells/fish.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - flake.modules.nixos.fish = {pkgs, ...}: { - users.defaultUserShell = pkgs.fish; - - programs.fish = { - enable = true; - shellAbbrs = { - l = "eza --grid --all"; - ll = "eza --long --all"; - ls = "eza"; - ".." = "cd .."; - "..." = "cd ../.."; - cat = "bat"; - }; - }; - }; -} diff --git a/modules/ssh.nix b/modules/ssh.nix deleted file mode 100644 index 77b1391..0000000 --- a/modules/ssh.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - flake.modules.nixos.base = { - programs.ssh = { - startAgent = true; - extraConfig = '' - AddKeysToAgent yes - Compression no - ControlMaster no - ControlPath ~/.ssh/master-%r@%n:%p - ControlPersist no - ForwardAgent no - HashKnownHosts no - ServerAliveCountMax 3 - ServerAliveInterval 0 - UserKnownHostsFile ~/.ssh/known_hosts - ''; - }; - }; - - flake.modules.homeManager.primaryUser = { - programs.ssh = { - enable = true; - enableDefaultConfig = false; - }; - }; -} diff --git a/modules/system-constants.nix b/modules/system-constants.nix deleted file mode 100644 index 93b3dd7..0000000 --- a/modules/system-constants.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - config, - lib, - self, - ... -}: { - options.systemConstants = lib.mkOption { - type = lib.types.lazyAttrsOf lib.types.unspecified; - default = {}; - }; - - config.systemConstants = rec { - infraName = "nixos"; - infraSystems = ["x86_64-linux"]; - - repositoryOwnerUsername = "asnev"; - repositoryOwnerEmail = "notasnev@proton.me"; - - nixpkgsStableVersion = "26.05"; - nixpkgsAllowUnfree = true; - nixpkgsOverlays = [self.overlays.default]; - - phostronHostname = "phostron"; - phostronHostPlatform = lib.elemAt infraSystems 0; - phostronStateVersion = nixpkgsStableVersion; - - homeManagerStateVersion = nixpkgsStableVersion; - - primaryUserUsername = "coyote"; - primaryUserHomeDirectory = - if lib.hasSuffix "linux" phostronHostPlatform - then "/home/${primaryUserUsername}" - else throw "Unsupported platform. See `modules/system-constants.nix`."; - primaryUserInfraDirectory = "${primaryUserHomeDirectory}/${infraName}"; - primaryUserId = 1000; - }; - - config._module.args.systemConstants = config.systemConstants; -} diff --git a/modules/users.nix b/modules/users.nix deleted file mode 100644 index 525e694..0000000 --- a/modules/users.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - self, - systemConstants, - ... -}: { - flake.modules.nixos = { - primaryUser = { - users.users.${systemConstants.primaryUserUsername} = { - isNormalUser = true; - description = systemConstants.primaryUserUsername; - home = systemConstants.primaryUserHomeDirectory; - uid = systemConstants.primaryUserId; - extraGroups = [ - "wheel" - "networkmanager" - "lp" - "scanner" - "video" - "render" - "input" - "audio" - "kvm" - ]; - }; - }; - - homeManagerModule = { - home-manager.users.${systemConstants.primaryUserUsername} = self.modules.homeManager.primaryUser; - }; - }; - - flake.modules.homeManager.primaryUser = { - home = { - username = systemConstants.primaryUserUsername; - homeDirectory = systemConstants.primaryUserHomeDirectory; - shell.enableShellIntegration = true; - stateVersion = systemConstants.homeManagerStateVersion; - }; - }; -} diff --git a/phostron.nix b/phostron.nix new file mode 100644 index 0000000..efc2064 --- /dev/null +++ b/phostron.nix @@ -0,0 +1,47 @@ +## phostron.nix --- Configuration module for `phostron' ## + +{ pkgs, ... }: + +{ + # ----- Module imports ----- # + imports = [ ./configuration.nix ]; + + + # ----- Hardware ----- # + zramSwap.enable = true; + + + # ----- Networking ----- # + networking.hostName = "phostron"; + + + # ----- Services ----- # + services = { + fstrim.enable = true; + }; + + # ----- Display manager ----- # + services.displayManager.sddm.enable = true; + + # ----- Desktop manager ----- # + # KDE Plasma ----- + services.desktopManager.plasma6.enable = true; + environment.plasma6.excludePackages = [ pkgs.kdePackages.discover ]; + environment.systemPackages = with pkgs.kdePackages; [ + kate elisa bluez-qt kalk filelight kamoso konversation kmail ktorrent + kclock + ]; + + # i3 ----- + services.xserver.windowManager.i3.enable = true; + services.xserver.windowManager.i3 = { + package = pkgs.unstable.i3; + extraPackages = with pkgs.unstable; [ dmenu i3status ]; + }; + programs.i3lock.enable = true; + + + # ----- DO NOT TOUCH ----- # + system.stateVersion = "26.05"; +} +# end of phostron.nix file