From e66c8d337a367cb2db0c334067f3ffe18eb2af3a Mon Sep 17 00:00:00 2001 From: asnev Date: Fri, 30 Oct 2026 03:52:41 +0700 Subject: [PATCH] added `xcursor-plan9` minor cleanup: moved package declarations out of `system-packages` into dedicated modules, `alejandra` gets configured as `nix fmt` command, removed `racket` --- flake.lock | 19 +++++++++- flake.nix | 4 +++ modules/flake-parts.nix | 8 +++-- modules/home/primaryUser/home-packages.nix | 2 +- modules/home/primaryUser/programs/nvf.nix | 6 +++- modules/hosts/phostron/display-manager.nix | 5 --- modules/nixos/modules/home-manager.nix | 8 +++-- modules/nixos/programs/nh.nix | 5 +++ modules/nixos/system-packages.nix | 3 -- modules/nixpkgs.nix | 6 +--- modules/packages/xcursor-plan9.nix | 37 +++++++++++++++++++ modules/repository/fmt.nix | 5 +++ modules/shells/direnv.nix | 8 +++++ modules/system-constants.nix | 12 +++---- modules/users.nix | 42 +++++++++++----------- 15 files changed, 124 insertions(+), 46 deletions(-) delete mode 100644 modules/hosts/phostron/display-manager.nix create mode 100644 modules/nixos/programs/nh.nix create mode 100644 modules/packages/xcursor-plan9.nix create mode 100644 modules/repository/fmt.nix create mode 100644 modules/shells/direnv.nix diff --git a/flake.lock b/flake.lock index aee4658..cf4544f 100644 --- a/flake.lock +++ b/flake.lock @@ -173,7 +173,24 @@ "nixpkgs-unstable" ], "nixpkgs-unstable": "nixpkgs-unstable", - "nvf": "nvf" + "nvf": "nvf", + "xcursor-plan9": "xcursor-plan9" + } + }, + "xcursor-plan9": { + "flake": false, + "locked": { + "lastModified": 1714831058, + "narHash": "sha256-74ykNDuknGdP6j+cS4ePtGTkGGLqQdpu54TuG7262QI=", + "owner": "wintermute-cell", + "repo": "xcursor-plan9", + "rev": "e0a605c16aff63f8eb958a8415441bf82de09245", + "type": "github" + }, + "original": { + "owner": "wintermute-cell", + "repo": "xcursor-plan9", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index b5a1583..423c8dc 100644 --- a/flake.nix +++ b/flake.nix @@ -18,5 +18,9 @@ url = "github:NotAShelf/nvf"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + xcursor-plan9 = { + url = "github:wintermute-cell/xcursor-plan9"; + flake = false; + }; }; } diff --git a/modules/flake-parts.nix b/modules/flake-parts.nix index 914be58..ded8a64 100644 --- a/modules/flake-parts.nix +++ b/modules/flake-parts.nix @@ -1,4 +1,8 @@ -{inputs, ...}: { +{ + inputs, + systemConstants, + ... +}: { flake-file.inputs = { flake-parts.url = "github:hercules-ci/flake-parts"; }; @@ -8,5 +12,5 @@ inputs.flake-parts.flakeModules.easyOverlay ]; - systems = ["x86_64-linux"]; + systems = systemConstants.infraSystems; } diff --git a/modules/home/primaryUser/home-packages.nix b/modules/home/primaryUser/home-packages.nix index 0a4ffd1..7c2667c 100644 --- a/modules/home/primaryUser/home-packages.nix +++ b/modules/home/primaryUser/home-packages.nix @@ -28,7 +28,7 @@ (bottles.override {removeWarningPopup = true;}) # development emacs - unstable.racket + unstable.guile ]; }; } diff --git a/modules/home/primaryUser/programs/nvf.nix b/modules/home/primaryUser/programs/nvf.nix index 530ac70..934d379 100644 --- a/modules/home/primaryUser/programs/nvf.nix +++ b/modules/home/primaryUser/programs/nvf.nix @@ -35,6 +35,10 @@ }; }; + visuals = { + rainbow-delimiters.enable = true; + }; + clipboard = { enable = true; registers = "unnamedplus"; @@ -104,7 +108,7 @@ mode = "i"; key = ""; action = "λ"; - desc = "inserts lambda"; + desc = "inserts lowercase lambda"; } ]; diff --git a/modules/hosts/phostron/display-manager.nix b/modules/hosts/phostron/display-manager.nix deleted file mode 100644 index cb07380..0000000 --- a/modules/hosts/phostron/display-manager.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - flake.modules.nixos.sddm = { - services.displayManager.sddm.settings.Theme.CursorSize = 18; - }; -} diff --git a/modules/nixos/modules/home-manager.nix b/modules/nixos/modules/home-manager.nix index 7d61999..0be6b9a 100644 --- a/modules/nixos/modules/home-manager.nix +++ b/modules/nixos/modules/home-manager.nix @@ -1,6 +1,10 @@ -{inputs, ...}: { +{ + inputs, + systemConstants, + ... +}: { flake-file.inputs.home-manager = { - url = "github:nix-community/home-manager/release-26.05"; + url = "github:nix-community/home-manager/release-${systemConstants.homeManagerStateVersion}"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/modules/nixos/programs/nh.nix b/modules/nixos/programs/nh.nix new file mode 100644 index 0000000..8ace298 --- /dev/null +++ b/modules/nixos/programs/nh.nix @@ -0,0 +1,5 @@ +{ + flake.modules.nixos.base = { + programs.nh.enable = true; + }; +} diff --git a/modules/nixos/system-packages.nix b/modules/nixos/system-packages.nix index 3b18369..a51976b 100644 --- a/modules/nixos/system-packages.nix +++ b/modules/nixos/system-packages.nix @@ -1,9 +1,6 @@ { flake.modules.nixos.base = {pkgs, ...}: { environment.systemPackages = with pkgs; [ - nh - alejandra - git python315 # system utils file diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index d2e5002..1a75531 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -12,11 +12,7 @@ in { nixpkgs-lib.follows = "nixpkgs-unstable"; }; - perSystem = { - final, - system, - ... - }: { + perSystem = {system, ...}: { _module.args.pkgs = import inputs.nixpkgs {inherit system overlays config;}; overlayAttrs.unstable = import inputs.nixpkgs-unstable {inherit system config;}; }; diff --git a/modules/packages/xcursor-plan9.nix b/modules/packages/xcursor-plan9.nix new file mode 100644 index 0000000..576978d --- /dev/null +++ b/modules/packages/xcursor-plan9.nix @@ -0,0 +1,37 @@ +{inputs, ...}: { + flake-file.inputs = { + xcursor-plan9 = { + url = "github:wintermute-cell/xcursor-plan9"; + flake = false; + }; + }; + + perSystem = { + config, + pkgs, + ... + }: { + packages.xcursor-plan9 = + (pkgs.callPackage (inputs.xcursor-plan9 + "/default.nix") {}) + .overrideAttrs (_: {src = inputs.xcursor-plan9;}); + + overlayAttrs = {inherit (config.packages) xcursor-plan9;}; + }; + + flake.modules.nixos = rec { + base = {pkgs, ...}: { + environment.systemPackages = [pkgs.xcursor-plan9]; + environment.variables = { + XCURSOR_THEME = "plan9"; + XCURSOR_SIZE = "16"; + }; + }; + + sddm = { + services.displayManager.sddm.settings.Theme = { + CursorTheme = base.environment.variables.XCURSOR_THEME; + CursorSize = base.environment.variables.XCURSOR_SIZE; + }; + }; + }; +} diff --git a/modules/repository/fmt.nix b/modules/repository/fmt.nix new file mode 100644 index 0000000..84c51af --- /dev/null +++ b/modules/repository/fmt.nix @@ -0,0 +1,5 @@ +{ + perSystem = {pkgs, ...}: { + formatter = pkgs.alejandra; + }; +} diff --git a/modules/shells/direnv.nix b/modules/shells/direnv.nix new file mode 100644 index 0000000..8d11f93 --- /dev/null +++ b/modules/shells/direnv.nix @@ -0,0 +1,8 @@ +{ + flake.modules.nixos.base = { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; +} diff --git a/modules/system-constants.nix b/modules/system-constants.nix index f0060d8..e65e5f9 100644 --- a/modules/system-constants.nix +++ b/modules/system-constants.nix @@ -1,7 +1,6 @@ { config, lib, - pkgs, self, ... }: { @@ -12,26 +11,27 @@ config.systemConstants = rec { infraName = "chitin"; + infraSystems = ["x86_64-linux"]; repositoryOwnerUsername = "asnev"; repositoryOwnerEmail = "notasnev@proton.me"; - nixpkgsStableVersion = "26.05"; # did you read the "did you read the comment?" comment? + nixpkgsStableVersion = "26.05"; nixpkgsAllowUnfree = true; nixpkgsOverlays = [self.overlays.default]; phostronHostname = "phostron"; - phostronHostPlatform = "x86_64-linux"; + phostronHostPlatform = lib.elemAt infraSystems 0; phostronStateVersion = nixpkgsStableVersion; homeManagerStateVersion = nixpkgsStableVersion; primaryUserUsername = "coyote"; primaryUserHomeDirectory = - if pkgs.stdenv.hostPlatform.isLinux + if lib.hasSuffix "linux" phostronHostPlatform then "/home/${primaryUserUsername}" - else throw "Unsupported platform: ${pkgs.stdenv.hostPlatform.system}"; - primaryUserInfraDirectory = "${primaryUserHomeDirectory}/${infraName}"; + else throw "Unsupported platform. See `modules/system-constants.nix`."; + primaryUserInfraDirectory = "${primaryUserHomeDirectory}/code/${infraName}"; primaryUserId = 1000; }; diff --git a/modules/users.nix b/modules/users.nix index 5d52d56..525e694 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -3,28 +3,30 @@ 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" - ]; + 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" + ]; + }; }; - }; - flake.modules.nixos.homeManagerModule = { - home-manager.users.${systemConstants.primaryUserUsername} = self.modules.homeManager.primaryUser; + homeManagerModule = { + home-manager.users.${systemConstants.primaryUserUsername} = self.modules.homeManager.primaryUser; + }; }; flake.modules.homeManager.primaryUser = {