Merge NixOS and home manager flakes

main
Hektor Misplon 2025-11-15 23:28:11 +01:00
parent bbaf22e871
commit 8ea508585b
8 changed files with 183 additions and 236 deletions

View File

@ -21,6 +21,46 @@
"type": "github" "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": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -42,6 +82,24 @@
"type": "github" "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": { "nixCats": {
"locked": { "locked": {
"lastModified": 1759730664, "lastModified": 1759730664,
@ -57,6 +115,27 @@
"type": "github" "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": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1762847253, "lastModified": 1762847253,
@ -228,10 +307,49 @@
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-secrets": "nix-secrets",
"nixgl": "nixgl",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "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"
} }
} }
}, },

View File

@ -11,10 +11,26 @@
url = "github:nix-community/disko/latest"; url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs"; 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 = { home-manager = {
url = "github:nix-community/home-manager/release-25.05"; url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs"; 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 = { nvim = {
url = "path:./dots/.config/nvim"; url = "path:./dots/.config/nvim";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -27,17 +43,30 @@
nixpkgs, nixpkgs,
nixos-hardware, nixos-hardware,
disko, disko,
sops-nix,
nix-secrets,
home-manager, home-manager,
nixgl,
firefox-addons,
nvim, nvim,
}: }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [ nixgl.overlay ];
};
in
{ {
nixosConfigurations = { nixosConfigurations = {
vm = nixpkgs.lib.nixosSystem { vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; inherit system;
specialArgs = {
inherit inputs;
};
modules = [ modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel
disko.nixosModules.disko disko.nixosModules.disko
home-manager.nixosModules.home-manager
./hosts/vm/configuration.nix ./hosts/vm/configuration.nix
{ {
environment.systemPackages = [ nvim.packages.x86_64-linux.nvim ]; environment.systemPackages = [ nvim.packages.x86_64-linux.nvim ];
@ -45,10 +74,12 @@
]; ];
}; };
astyanax = nixpkgs.lib.nixosSystem { astyanax = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; inherit system;
specialArgs = {
inherit inputs;
};
modules = [ modules = [
disko.nixosModules.disko disko.nixosModules.disko
home-manager.nixosModules.home-manager
./hosts/astyanax/configuration.nix ./hosts/astyanax/configuration.nix
{ {
environment.systemPackages = [ nvim.packages.x86_64-linux.nvim ]; 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
];
};
};
}; };
} }

View File

@ -1 +0,0 @@
# Nix `home-manager` flake

View File

@ -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
}

View File

@ -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
];
};
};
};
}

View File

@ -11,12 +11,12 @@
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
initExtra = '' initExtra = ''
for f in ${config.home.homeDirectory}/.bashrc.d/*; do for f in /home/h/.bashrc.d/*; do
[ -f "$f" ] && source "$f" [ -f "$f" ] && source "$f"
done done
source ${config.home.homeDirectory}/.bash_aliases/all source /home/h/.bash_aliases/all
source ${config.home.homeDirectory}/.bash_aliases/lang-js source /home/h/.bash_aliases/lang-js
# host-specific config goes here # host-specific config goes here
# ... # ...

View File

@ -1,9 +1,15 @@
{ pkgs, ... }: {
inputs,
config,
pkgs,
...
}:
{ {
system.stateVersion = "25.05"; system.stateVersion = "25.05";
imports = [ imports = [
inputs.home-manager.nixosModules.default
./hard.nix ./hard.nix
../../modules/bootloader.nix ../../modules/bootloader.nix
../../modules/disko.zfs-encrypted-root.nix ../../modules/disko.zfs-encrypted-root.nix
@ -34,7 +40,11 @@
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
users.h = ../../home/hosts/astyanax; users.h = import ../../home/hosts/astyanax {
inherit inputs;
inherit config;
inherit pkgs;
};
}; };
networking.hostId = "80eef97e"; networking.hostId = "80eef97e";

View File

@ -1,9 +1,10 @@
{ ... }: { inputs, ... }:
{ {
system.stateVersion = "25.05"; system.stateVersion = "25.05";
imports = [ imports = [
inputs.home-manager.nixosModules.default
./hard.nix ./hard.nix
./disk.nix ./disk.nix
../../modules/bootloader.nix ../../modules/bootloader.nix