diff --git a/flake.lock b/flake.lock index 81b99d4..d86fd81 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,46 @@ "type": "github" } }, + "firefox-addons": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1763179480, + "narHash": "sha256-bsHnmNm/2ev8XNzKibc6swU5zM2bB3/v3UbtlQyS1dA=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "6831e9334d8efd7b1f9b570be748e7cf0173f6b7", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -42,6 +82,24 @@ "type": "github" } }, + "nix-secrets": { + "flake": false, + "locked": { + "lastModified": 1762546290, + "narHash": "sha256-a0mXF68to0eJQiIq1vCBMcGCX1UA1lBpwHgCinKfORA=", + "ref": "main", + "rev": "b0473511f3718fb95f01e6c8bad6da3eb582974c", + "shallow": true, + "type": "git", + "url": "ssh://git@github.com/hektor/nix-secrets" + }, + "original": { + "ref": "main", + "shallow": true, + "type": "git", + "url": "ssh://git@github.com/hektor/nix-secrets" + } + }, "nixCats": { "locked": { "lastModified": 1759730664, @@ -57,6 +115,27 @@ "type": "github" } }, + "nixgl": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1762090880, + "narHash": "sha256-fbRQzIGPkjZa83MowjbD2ALaJf9y6KMDdJBQMKFeY/8=", + "owner": "nix-community", + "repo": "nixGL", + "rev": "b6105297e6f0cd041670c3e8628394d4ee247ed5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixGL", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1762847253, @@ -228,10 +307,49 @@ "root": { "inputs": { "disko": "disko", + "firefox-addons": "firefox-addons", "home-manager": "home-manager", + "nix-secrets": "nix-secrets", + "nixgl": "nixgl", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", - "nvim": "nvim" + "nvim": "nvim", + "sops-nix": "sops-nix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763069729, + "narHash": "sha256-A91a+K0Q9wfdPLwL06e/kbHeAWSzPYy2EGdTDsyfb+s=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "a2bcd1c25c1d29e22756ccae094032ab4ada2268", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 3156d0e..c7ec8e6 100644 --- a/flake.nix +++ b/flake.nix @@ -11,10 +11,26 @@ url = "github:nix-community/disko/latest"; inputs.nixpkgs.follows = "nixpkgs"; }; + sops-nix = { + url = "github:Mic92/sops-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nix-secrets = { + url = "git+ssh://git@github.com/hektor/nix-secrets?shallow=1&ref=main"; + flake = false; + }; home-manager = { url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixgl = { + url = "github:nix-community/nixGL"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nvim = { url = "path:./dots/.config/nvim"; inputs.nixpkgs.follows = "nixpkgs"; @@ -27,17 +43,30 @@ nixpkgs, nixos-hardware, disko, + sops-nix, + nix-secrets, home-manager, + nixgl, + firefox-addons, nvim, - }: + }@inputs: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + overlays = [ nixgl.overlay ]; + }; + in { nixosConfigurations = { vm = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; + inherit system; + specialArgs = { + inherit inputs; + }; modules = [ nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel disko.nixosModules.disko - home-manager.nixosModules.home-manager ./hosts/vm/configuration.nix { environment.systemPackages = [ nvim.packages.x86_64-linux.nvim ]; @@ -45,10 +74,12 @@ ]; }; astyanax = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; + inherit system; + specialArgs = { + inherit inputs; + }; modules = [ disko.nixosModules.disko - home-manager.nixosModules.home-manager ./hosts/astyanax/configuration.nix { environment.systemPackages = [ nvim.packages.x86_64-linux.nvim ]; @@ -56,5 +87,16 @@ ]; }; }; + homeConfigurations = { + work = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit inputs; + }; + modules = [ + ./home/hosts/work + ]; + }; + }; }; } diff --git a/home/README.md b/home/README.md deleted file mode 100644 index caffd7e..0000000 --- a/home/README.md +++ /dev/null @@ -1 +0,0 @@ -# Nix `home-manager` flake diff --git a/home/flake.lock b/home/flake.lock deleted file mode 100644 index 6d5e264..0000000 --- a/home/flake.lock +++ /dev/null @@ -1,166 +0,0 @@ -{ - "nodes": { - "firefox-addons": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "dir": "pkgs/firefox-addons", - "lastModified": 1762315418, - "narHash": "sha256-mLJeHkYvojbq/1vot6IXq85l0sN9KlAPbRzYo4Mnc4g=", - "owner": "rycee", - "repo": "nur-expressions", - "rev": "ccdfe1d5d7da86941ac363b5bf2b5bc88b15def2", - "type": "gitlab" - }, - "original": { - "dir": "pkgs/firefox-addons", - "owner": "rycee", - "repo": "nur-expressions", - "type": "gitlab" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1762351818, - "narHash": "sha256-0ptUDbYwxv1kk/uzEX4+NJjY2e16MaAhtzAOJ6K0TG0=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "b959c67241cae17fc9e4ee7eaf13dfa8512477ea", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "nix-secrets": { - "flake": false, - "locked": { - "lastModified": 1762463676, - "narHash": "sha256-PMNLD8PPcei/1SwNph+CVTBw+3SvlN2R/CnTUFJO5O0=", - "ref": "main", - "rev": "183554d159e1d8ea1f1d2d626b6686ebcb37a612", - "shallow": true, - "type": "git", - "url": "ssh://git@github.com/hektor/nix-secrets" - }, - "original": { - "ref": "main", - "shallow": true, - "type": "git", - "url": "ssh://git@github.com/hektor/nix-secrets" - } - }, - "nixgl": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1762090880, - "narHash": "sha256-fbRQzIGPkjZa83MowjbD2ALaJf9y6KMDdJBQMKFeY/8=", - "owner": "nix-community", - "repo": "nixGL", - "rev": "b6105297e6f0cd041670c3e8628394d4ee247ed5", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixGL", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1762498405, - "narHash": "sha256-Zg/SCgCaAioc0/SVZQJxuECGPJy+OAeBcGeA5okdYDc=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "6faeb062ee4cf4f105989d490831713cc5a43ee1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-25.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "firefox-addons": "firefox-addons", - "home-manager": "home-manager", - "nix-secrets": "nix-secrets", - "nixgl": "nixgl", - "nixpkgs": "nixpkgs", - "sops-nix": "sops-nix" - } - }, - "sops-nix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1760998189, - "narHash": "sha256-ee2e1/AeGL5X8oy/HXsZQvZnae6XfEVdstGopKucYLY=", - "owner": "Mic92", - "repo": "sops-nix", - "rev": "5a7d18b5c55642df5c432aadb757140edfeb70b3", - "type": "github" - }, - "original": { - "owner": "Mic92", - "repo": "sops-nix", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/home/flake.nix b/home/flake.nix deleted file mode 100644 index a44d5a1..0000000 --- a/home/flake.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ - inputs = { - nixpkgs = { - url = "github:nixos/nixpkgs?ref=nixos-25.05"; - }; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - sops-nix = { - url = "github:Mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nix-secrets = { - url = "git+ssh://git@github.com/hektor/nix-secrets?shallow=1&ref=main"; - flake = false; - }; - nixgl = { - url = "github:nix-community/nixGL"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - firefox-addons = { - url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; - - outputs = - { - nixpkgs, - home-manager, - nixgl, - ... - }@inputs: - let - lib = nixpkgs.lib; - system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - overlays = [ nixgl.overlay ]; - config.allowUnfree = true; - }; - in - { - homeConfigurations = { - work = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { - inherit inputs; - }; - modules = [ - ./hosts/work - ]; - }; - }; - }; -} diff --git a/home/hosts/astyanax/default.nix b/home/hosts/astyanax/default.nix index 1a856b2..93213e2 100644 --- a/home/hosts/astyanax/default.nix +++ b/home/hosts/astyanax/default.nix @@ -11,12 +11,12 @@ enable = true; enableCompletion = true; initExtra = '' - for f in ${config.home.homeDirectory}/.bashrc.d/*; do + for f in /home/h/.bashrc.d/*; do [ -f "$f" ] && source "$f" done - source ${config.home.homeDirectory}/.bash_aliases/all - source ${config.home.homeDirectory}/.bash_aliases/lang-js + source /home/h/.bash_aliases/all + source /home/h/.bash_aliases/lang-js # host-specific config goes here # ... diff --git a/hosts/astyanax/configuration.nix b/hosts/astyanax/configuration.nix index 4ce8e97..1299359 100644 --- a/hosts/astyanax/configuration.nix +++ b/hosts/astyanax/configuration.nix @@ -1,9 +1,15 @@ -{ pkgs, ... }: +{ + inputs, + config, + pkgs, + ... +}: { system.stateVersion = "25.05"; imports = [ + inputs.home-manager.nixosModules.default ./hard.nix ../../modules/bootloader.nix ../../modules/disko.zfs-encrypted-root.nix @@ -34,7 +40,11 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; - users.h = ../../home/hosts/astyanax; + users.h = import ../../home/hosts/astyanax { + inherit inputs; + inherit config; + inherit pkgs; + }; }; networking.hostId = "80eef97e"; diff --git a/hosts/vm/configuration.nix b/hosts/vm/configuration.nix index 41e703c..c421e0b 100644 --- a/hosts/vm/configuration.nix +++ b/hosts/vm/configuration.nix @@ -1,9 +1,10 @@ -{ ... }: +{ inputs, ... }: { system.stateVersion = "25.05"; imports = [ + inputs.home-manager.nixosModules.default ./hard.nix ./disk.nix ../../modules/bootloader.nix