From 4a532feadbf2b7354b70ef26f2028bc4b35d1d26 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Mon, 25 Mar 2024 13:44:56 -0700 Subject: [PATCH] Add version suffix in nixos module --- flake.nix | 39 +++++++++++++++++++-------------------- module.nix | 4 ++-- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/flake.nix b/flake.nix index ae5a679..b58990e 100644 --- a/flake.nix +++ b/flake.nix @@ -8,25 +8,24 @@ inputs.flake-compat.url = "git+ssh://git@git.lix.systems/lix-project/flake-compat"; inputs.flakey-profile.url = "github:lf-/flakey-profile"; - outputs = inputs@{ self, nixpkgs, lix, flake-utils, flakey-profile, ... }: { - inherit inputs; - nixosModules.default = import ./module.nix { inherit lix; }; - overlays.default = import ./overlay.nix { - inherit lix; - versionSuffix = "pre${builtins.substring 0 8 lix.lastModifiedDate}-${lix.shortRev}"; - }; - } // flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ self.overlays.default ]; - }; - in - { - inherit pkgs; - packages.default = pkgs.nixVersions.nix_2_18; - packages.nix-doc = pkgs.nix-doc; + outputs = inputs@{ self, nixpkgs, lix, flake-utils, flakey-profile, ... }: + let versionSuffix = "pre${builtins.substring 0 8 lix.lastModifiedDate}-${lix.shortRev}"; + in { + inherit inputs; + nixosModules.default = import ./module.nix { inherit lix versionSuffix; }; + overlays.default = import ./overlay.nix { inherit lix versionSuffix; }; + } // flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlays.default ]; + }; + in + { + inherit pkgs; + packages.default = pkgs.nixVersions.nix_2_18; + packages.nix-doc = pkgs.nix-doc; - packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; }; - }); + packages.system-profile = import ./system-profile.nix { inherit pkgs flakey-profile; }; + }); } diff --git a/module.nix b/module.nix index 0bb1c7b..5e7f1bf 100644 --- a/module.nix +++ b/module.nix @@ -1,5 +1,5 @@ -{ lix }: +{ lix, versionSuffix ? "" }: { pkgs, config, ... }: { - nixpkgs.overlays = [ (import ./overlay.nix { inherit lix; }) ]; + nixpkgs.overlays = [ (import ./overlay.nix { inherit lix versionSuffix; }) ]; }