Make config host independant

This commit is contained in:
willifan 2024-05-19 20:11:53 +02:00
parent d0317d9b39
commit dc30940074
8 changed files with 67 additions and 20 deletions

View File

@ -1,12 +1,32 @@
{
"nodes": {
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1716126753,
"narHash": "sha256-fdodsQ2AWreGj4arHk6cKcnqlWrNiLb64eRrHtMZ5cw=",
"owner": "nix-community",
"repo": "disko",
"rev": "601be8412d2ab72f752448766fe0fb2f00d5c40c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"hardware": {
"locked": {
"lastModified": 1715148395,
"narHash": "sha256-lRxjTxY3103LGMjWdVqntKZHhlmMX12QUjeFrQMmGaE=",
"lastModified": 1716141623,
"narHash": "sha256-4NEvf7sULDyYoXIgeXHWGe7mXlr7+UL7TvgDkMqpbPY=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "a4e2b7909fc1bdf30c30ef21d388fde0b5cdde4a",
"rev": "f0cf56878046c42ec2096a2ade89203e7348917b",
"type": "github"
},
"original": {
@ -22,11 +42,11 @@
]
},
"locked": {
"lastModified": 1715486357,
"narHash": "sha256-4pRuzsHZOW5W4CsXI9uhKtiJeQSUoe1d2M9mWU98HC4=",
"lastModified": 1715930644,
"narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "44677a1c96810a8e8c4ffaeaad10c842402647c1",
"rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d",
"type": "github"
},
"original": {
@ -37,11 +57,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1715447595,
"narHash": "sha256-VsVAUQOj/cS1LCOmMjAGeRksXIAdPnFIjCQ0XLkCsT0=",
"lastModified": 1715961556,
"narHash": "sha256-+NpbZRCRisUHKQJZF3CT+xn14ZZQO+KjxIIanH3Pvn4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "062ca2a9370a27a35c524dc82d540e6e9824b652",
"rev": "4a6b83b05df1a8bd7d99095ec4b4d271f2956b64",
"type": "github"
},
"original": {
@ -53,11 +73,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1715395895,
"narHash": "sha256-DreMqi6+qa21ffLQqhMQL2XRUkAGt3N7iVB5FhJKie4=",
"lastModified": 1716061101,
"narHash": "sha256-H0eCta7ahEgloGIwE/ihkyGstOGu+kQwAiHvwVoXaA0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "71bae31b7dbc335528ca7e96f479ec93462323ff",
"rev": "e7cc61784ddf51c81487637b3031a6dd2d6673a2",
"type": "github"
},
"original": {
@ -69,6 +89,7 @@
},
"root": {
"inputs": {
"disko": "disko",
"hardware": "hardware",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",

View File

@ -28,7 +28,7 @@
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
outputs = { self, nixpkgs, home-manager, disko, ... }@inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
@ -41,6 +41,7 @@
{
# Please replace my-nixos with your hostname
nixosConfigurations = {
Lenni = lib.nixosSystem {
inherit specialArgs;
modules = [
@ -51,10 +52,28 @@
#home-manager.users.willifan = import ./users/willifan/home;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
}
disko.nixosModules.disko
./hosts
./users/willifan
];
};
Puenktchen = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
#home-manager.users.willifan = import ./users/willifan/home;
# Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix
}
disko.nixosModules.disko
./hosts
./users/willifan
];
};
};
};
}

View File

@ -2,6 +2,6 @@
{
imports = [
./hardware-configuration.nix
#./disko.nix
./disko.nix
];
}

View File

@ -41,6 +41,10 @@
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/nix";
};
"/mnt/data" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/mnt/data";
};
# Subvolume for the swapfile
"/swap" = {
mountpoint = "/.swapvol";

View File

@ -1,6 +1,6 @@
{ pkgs, ... }:
{ pkgs, configVars, ... }:
{
networking.hostName = "Lenni";
networking.hostName = configVars.hostname;
imports = [
./nix-ld.nix
./boot.nix

View File

@ -1,7 +1,7 @@
{ pkgs, ... }:
{ pkgs, configVars, ... }:
{
imports = [
./common
./Lenni
./${configVars.hostname}
];
}

View File

@ -4,6 +4,7 @@
programs.kitty = {
enable = true;
settings = {
background_opacity = "0.85";
enable_audio_bell = false;
};
};

View File

@ -1,4 +1,6 @@
{ pkgs, ... }:
{ ... }:
{
username = "willifan";
hostname = "Lenni";
email = "willifan@proton.me";
}