diff --git a/flake.lock b/flake.lock index 49a0b16..aee4658 100644 --- a/flake.lock +++ b/flake.lock @@ -149,11 +149,11 @@ ] }, "locked": { - "lastModified": 1792889789, - "narHash": "sha256-xpH3z+T5NELixXRjxGJ3mx30kz63Xt2B0ZfPWl7hcUg=", + "lastModified": 1793047357, + "narHash": "sha256-eY8aBTGSgtx+25254i22jyjbj+JQkEIfb+JyQ2Exnuk=", "owner": "NotAShelf", "repo": "nvf", - "rev": "557d2eb05a76e5939e6a75351343cae5731a71f8", + "rev": "60b4593979c39e9a1227c9913bd835bb1a59054b", "type": "github" }, "original": { @@ -169,6 +169,9 @@ "home-manager": "home-manager", "import-tree": "import-tree", "nixpkgs": "nixpkgs", + "nixpkgs-lib": [ + "nixpkgs-unstable" + ], "nixpkgs-unstable": "nixpkgs-unstable", "nvf": "nvf" } diff --git a/flake.nix b/flake.nix index 635852c..b5a1583 100644 --- a/flake.nix +++ b/flake.nix @@ -1,16 +1,22 @@ +# DO-NOT-EDIT. This file was auto-generated using github:denful/flake-file. +# Use `nix run .#write-flake` to regenerate it. { + outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); + inputs = { - flake-parts.url = "github:hercules-ci/flake-parts"; 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"; + }; 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/nixos/unstable/nixos-26.11pre1100280.3ec636362e18/nixexprs.tar.zst"; - home-manager.url = "github:nix-community/home-manager/release-26.05"; - nvf.url = "github:NotAShelf/nvf"; - - home-manager.inputs.nixpkgs.follows = "nixpkgs"; - nvf.inputs.nixpkgs.follows = "nixpkgs-unstable"; + nvf = { + url = "github:NotAShelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; }; - - outputs = inputs: inputs.flake-parts.lib.mkFlake {inherit inputs;} (inputs.import-tree ./modules); } diff --git a/modules/flake-parts.nix b/modules/flake-parts.nix index 5def68a..914be58 100644 --- a/modules/flake-parts.nix +++ b/modules/flake-parts.nix @@ -1,9 +1,12 @@ {inputs, ...}: { + flake-file.inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + imports = [ inputs.flake-parts.flakeModules.modules inputs.flake-parts.flakeModules.easyOverlay - inputs.flake-file.flakeModules.default ]; - systems = []; + systems = ["x86_64-linux"]; } diff --git a/modules/flake/outputs.nix b/modules/flake/outputs.nix deleted file mode 100644 index 41a86db..0000000 --- a/modules/flake/outputs.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - flake-file.outputs = '' - inputs: inputs.flake-parts.lib.mkFlake {inherit inputs;} (inputs.import-tree ./modules); - ''; -} diff --git a/modules/generic/system-constants.nix b/modules/generic/system-constants.nix new file mode 100644 index 0000000..1772668 --- /dev/null +++ b/modules/generic/system-constants.nix @@ -0,0 +1,34 @@ +{self, ...}: let + imports = [self.modules.generic.systemConstants]; +in { + flake.modules.generic.systemConstants = {config, lib, ...}: { + options.systemConstants = lib.mkOption { + type = lib.types.lazyAttrsOf lib.types.unspecified; + default = {}; + }; + + config.systemConstants = { + repositoryOwnerUsername = "asnev"; + repositoryOwnerEmail = "notasnev@proton.me"; + + nixpkgsStateVersion = "26.05"; + nixpkgsAllowUnfree = true; + + homeManagerStateVersion = config.systemConstants.nixpkgsStateVersion; + + primaryUserUsername = "coyote"; + primaryUserHomeDirectory = "/home/coyote"; + primaryUserId = 1000; + + phostronHostname = "phostron"; + phostronHostPlatform = "x86_64-linux"; + phostronStateVersion = config.systemConstants.nixpkgsStateVersion; + }; + }; + + perSystem = {inherit imports;}; + flake.modules = { + nixos.base = {inherit imports;}; + homeManager.primaryUser = {inherit imports;}; + }; +} diff --git a/modules/home/primaryUser/programs/lazygit.nix b/modules/home/primaryUser/programs/lazygit.nix new file mode 100644 index 0000000..0b11cf2 --- /dev/null +++ b/modules/home/primaryUser/programs/lazygit.nix @@ -0,0 +1,13 @@ +{ + flake.modules.homeManager.primaryUser = {pkgs, ...}: { + programs.lazygit = { + enable = true; + package = pkgs.unstable.lazygit; + settings = { + git = { + overrideGpg = true; + }; + }; + }; + }; +} diff --git a/modules/home/primaryUser/programs/nvf.nix b/modules/home/primaryUser/programs/nvf.nix index 89d2993..530ac70 100644 --- a/modules/home/primaryUser/programs/nvf.nix +++ b/modules/home/primaryUser/programs/nvf.nix @@ -1,9 +1,13 @@ {inputs, ...}: { + flake-file.inputs.nvf = { + url = "github:NotAShelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + flake.modules.homeManager.primaryUser = {pkgs, ...}: { imports = [inputs.nvf.homeManagerModules.default]; home.packages = with pkgs.unstable; [ - lazygit tree-sitter ]; diff --git a/modules/hosts/phostron/boot.nix b/modules/hosts/phostron/boot.nix index 5ba475c..86caeb2 100644 --- a/modules/hosts/phostron/boot.nix +++ b/modules/hosts/phostron/boot.nix @@ -11,6 +11,7 @@ "sd_mod" "sdhci_pci" ]; + kernelModules = []; }; diff --git a/modules/hosts/phostron/entry.nix b/modules/hosts/phostron/entry.nix index e3e4398..8b5941a 100644 --- a/modules/hosts/phostron/entry.nix +++ b/modules/hosts/phostron/entry.nix @@ -3,7 +3,11 @@ inputs, ... }: { - flake.modules.nixos.phostron = {config, lib, ...}: { + flake.modules.nixos.phostron = { + config, + lib, + ... + }: { networking.hostName = config.systemConstants.phostronHostname; nixpkgs.hostPlatform = lib.mkDefault config.systemConstants.phostronHostPlatform; system.stateVersion = config.systemConstants.phostronStateVersion; @@ -22,6 +26,7 @@ homeManagerModule fish + starship primaryUser ]; }; diff --git a/modules/nixos/modules/home-manager.nix b/modules/nixos/modules/home-manager.nix index 56cb4bb..7d61999 100644 --- a/modules/nixos/modules/home-manager.nix +++ b/modules/nixos/modules/home-manager.nix @@ -1,4 +1,9 @@ {inputs, ...}: { + flake-file.inputs.home-manager = { + url = "github:nix-community/home-manager/release-26.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake.modules.nixos.homeManagerModule = { imports = [inputs.home-manager.nixosModules.home-manager]; diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix index cffdb17..cd22b11 100644 --- a/modules/nixpkgs.nix +++ b/modules/nixpkgs.nix @@ -1,32 +1,37 @@ { - self, inputs, + self, ... }: let - allowUnfree = true; overlays = [self.overlays.default]; in { + flake-file.inputs = { + nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst"; + nixpkgs-unstable.url = "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1100280.3ec636362e18/nixexprs.tar.zst"; + nixpkgs-lib.follows = "nixpkgs-unstable"; + }; + perSystem = { - pkgs, + config, final, system, ... }: { _module.args.pkgs = import inputs.nixpkgs { inherit system overlays; - config = {inherit allowUnfree;}; + config.allowUnfree = config.systemConstants.nixpkgsAllowUnfree; }; overlayAttrs.unstable = import inputs.nixpkgs-unstable { inherit system; - config = {inherit allowUnfree;}; + config.allowUnfree = config.systemConstants.nixpkgsAllowUnfree; }; }; - flake.modules.nixos.base = { + flake.modules.nixos.base = {config, ...}: { nixpkgs = { inherit overlays; - config = {inherit allowUnfree;}; + config.allowUnfree = config.systemConstants.nixpkgsAllowUnfree; }; }; } diff --git a/modules/shared/system-constants.nix b/modules/shared/system-constants.nix deleted file mode 100644 index 6055768..0000000 --- a/modules/shared/system-constants.nix +++ /dev/null @@ -1,25 +0,0 @@ -{self, ...}: let - imports = [self.modules.generic.systemConstants]; -in { - flake.modules.generic.systemConstants = {lib, ...}: { - options.systemConstants = lib.mkOption { - type = lib.types.attrsOf lib.types.unspecified; - default = {}; - }; - - config.systemConstants = { - repositoryOwnerUsername = "asnev"; - repositoryOwnerEmail = "notasnev@proton.me"; - - primaryUserUsername = "coyote"; - primaryUserHomeDirectory = "/home/coyote"; - - phostronHostname = "phostron"; - phostronHostPlatform = "x86_64-linux"; - phostronStateVersion = "26.05"; # what comment? - }; - }; - - flake.modules.nixos.base = {inherit imports;}; - flake.modules.homeManager.primaryUser = {inherit imports;}; -} diff --git a/modules/fish.nix b/modules/shells/fish.nix similarity index 100% rename from modules/fish.nix rename to modules/shells/fish.nix diff --git a/modules/home/primaryUser/programs/starship.nix b/modules/shells/starship.nix similarity index 79% rename from modules/home/primaryUser/programs/starship.nix rename to modules/shells/starship.nix index 9fb7d3e..e4aeca0 100644 --- a/modules/home/primaryUser/programs/starship.nix +++ b/modules/shells/starship.nix @@ -1,9 +1,9 @@ { - flake.modules.homeManager.primaryUser = {pkgs, ...}: { + flake.modules.nixos.starship = {pkgs, ...}: { programs.starship = { enable = true; package = pkgs.unstable.starship; - enableTransience = true; + transientPrompt.enable = true; settings = { "$schema" = "https://starship.rs/config-schema.json"; git_status = { diff --git a/modules/users.nix b/modules/users.nix index 6b08936..2e8218a 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -4,7 +4,7 @@ isNormalUser = true; description = config.systemConstants.primaryUserUsername; home = config.systemConstants.primaryUserHomeDirectory; - uid = 1000; + uid = config.systemConstants.primaryUserId; extraGroups = [ "wheel" "networkmanager" @@ -23,7 +23,7 @@ home-manager.users.${config.systemConstants.primaryUserUsername} = self.modules.homeManager.primaryUser; }; - flake.modules.homeManager.primaryUser = {config, lib, ...}: { + flake.modules.homeManager.primaryUser = {config, ...}: { home = { username = config.systemConstants.primaryUserUsername; homeDirectory = config.systemConstants.primaryUserHomeDirectory; diff --git a/modules/write-flake.nix b/modules/write-flake.nix new file mode 100644 index 0000000..e773727 --- /dev/null +++ b/modules/write-flake.nix @@ -0,0 +1,12 @@ +{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)"; +}