chore: clean up nixos configurations
Some checks are pending
Continuous Integration / Checks (push) Waiting to run

Consolidate nixpkgs instances into once for all x86 systems
This commit is contained in:
Tim Schubert 2025-07-27 15:13:36 +02:00
parent 712cca5909
commit 578d4526e5
No known key found for this signature in database
13 changed files with 92 additions and 161 deletions

17
flake.lock generated
View file

@ -325,22 +325,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-small": {
"locked": {
"lastModified": 1753505055,
"narHash": "sha256-jQKnNATDGDeuIeUf7r0yHnmirfYkYPHeF0N2Lv8rjPE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7be0239edbf0783ff959f94f9728db414be73002",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1730741070, "lastModified": 1730741070,
@ -397,7 +381,6 @@
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-small": "nixpkgs-small",
"systems": "systems_2", "systems": "systems_2",
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
} }

View file

@ -2,7 +2,6 @@
description = "dadada's nix flake"; description = "dadada's nix flake";
inputs = { inputs = {
nixpkgs-small.url = "github:NixOS/nixpkgs/nixos-unstable-small";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";

View file

@ -1,7 +0,0 @@
{ pkgs }:
{
allowUnfree = true;
allowUnfreePredicate = pkg: true;
allowBroken = false;
android_sdk.accept_license = true;
}

View file

@ -125,7 +125,6 @@ with pkgs;
spotify spotify
sqlite sqlite
sshfs-fuse sshfs-fuse
steam
taplo taplo
tcpdump tcpdump
tdesktop tdesktop

View file

@ -1,4 +0,0 @@
{ self, nixpkgs, ... }:
(nixpkgs.lib.mapAttrs' (
name: config: nixpkgs.lib.nameValuePair name config.config.system.build.toplevel
) self.nixosConfigurations)

View file

@ -8,127 +8,92 @@
nixos-hardware, nixos-hardware,
nixos-generators, nixos-generators,
nixpkgs, nixpkgs,
nixpkgs-small,
... ...
}@inputs: }@inputs:
let let
nixosSystem = # create a new instance allowing some unfree packages
{ nixpkgsx86 = import nixpkgs {
nixpkgs,
system ? "x86_64-linux",
extraModules ? [ ],
}:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
{
nixpkgs.overlays = nixpkgs.lib.attrValues self.overlays;
}
]
++ (nixpkgs.lib.attrValues self.nixosModules)
++ [ agenix.nixosModules.age ]
++ extraModules;
};
in
{
stolas =
let
system = "x86_64-linux"; system = "x86_64-linux";
in config.allowUnfreePredicate =
nixosSystem { pkg:
inherit nixpkgs system; builtins.elem (nixpkgs.lib.getName pkg) [
"aspell-dict-en-science"
extraModules = [ "brgenml1lpr"
lanzaboote.nixosModules.lanzaboote "saleae-logic-2"
disko.nixosModules.disko "spotify"
{ ];
nixpkgs.overlays = nixpkgs.lib.attrValues self.overlays;
dadada.pkgs = self.packages.${system};
dadada.inputs = inputs // {
dadada = self;
}; };
} nixosSystem = nixpkgs.lib.nixosSystem;
nixos-hardware.nixosModules.framework-amd-ai-300-series baseModule =
home-manager.nixosModules.home-manager { lib, ... }:
{
_module.args.inputs = inputs;
imports = [
inputs.agenix.nixosModules.age
inputs.disko.nixosModules.disko
inputs.home-manager.nixosModules.home-manager
( (
{ pkgs, ... }: { pkgs, ... }:
{ {
home-manager.useGlobalPkgs = true; dadada.homepage.package = homepage;
home-manager.useUserPackages = true; dadada.pkgs = inputs.self.packages.${pkgs.system};
home-manager.sharedModules = (nixpkgs.lib.attrValues self.hmModules) ++ [ dadada.inputs = inputs // {
{ dadada.home.helix.package = pkgs.helix; } dadada = inputs.self;
]; };
home-manager.users.dadada = import ../home;
} }
) )
inputs.lanzaboote.nixosModules.lanzaboote
]
++ (lib.attrValues inputs.self.nixosModules);
};
homeModule = ./modules/profiles/home.nix;
in
{
stolas = nixosSystem {
modules = [
{ nixpkgs.pkgs = nixpkgsx86; }
baseModule
nixos-hardware.nixosModules.framework-amd-ai-300-series
homeModule
./stolas ./stolas
]; ];
}; };
gorgon = gorgon = nixosSystem {
let modules = [
system = "x86_64-linux"; { nixpkgs.pkgs = nixpkgsx86; }
in baseModule
nixosSystem {
inherit nixpkgs system;
extraModules = [
{
nixpkgs.overlays = nixpkgs.lib.attrValues self.overlays;
dadada.pkgs = self.packages.${system};
dadada.inputs = inputs // {
dadada = self;
};
}
nixos-hardware.nixosModules.lenovo-thinkpad-t14s-amd-gen1 nixos-hardware.nixosModules.lenovo-thinkpad-t14s-amd-gen1
home-manager.nixosModules.home-manager homeModule
(
{ pkgs, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = (nixpkgs.lib.attrValues self.hmModules) ++ [
{ dadada.home.helix.package = pkgs.helix; }
{ manual.manpages.enable = false; }
];
home-manager.users.dadada = import ../home;
}
)
./gorgon/configuration.nix ./gorgon/configuration.nix
]; ];
}; };
surgat = nixosSystem { surgat = nixosSystem {
nixpkgs = nixpkgs-small; modules = [
system = "x86_64-linux"; { nixpkgs.pkgs = nixpkgsx86; }
extraModules = [ baseModule
{
dadada.homepage.package = homepage;
}
./modules/profiles/server.nix
./surgat/configuration.nix ./surgat/configuration.nix
]; ];
}; };
agares = nixosSystem { agares = nixosSystem {
nixpkgs = nixpkgs-small; modules = [
extraModules = [ { nixpkgs.pkgs = nixpkgsx86; }
baseModule
./agares/configuration.nix ./agares/configuration.nix
]; ];
}; };
installer = installer = nixosSystem {
let
nixpkgs = nixpkgs-small;
in
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [ modules = [
nixos-generators.nixosModules.install-iso nixos-generators.nixosModules.install-iso
self.nixosModules.admin inputs.self.nixosModules.admin
(
{ lib, ... }:
{ {
isoImage.isoName = nixpkgs.lib.mkForce "dadada-nixos-installer.iso"; nixpkgs.pkgs = nixpkgs.legacyPackages."x86_64-linux";
isoImage.isoName = lib.mkForce "dadada-nixos-installer.iso";
networking.tempAddresses = "disabled"; networking.tempAddresses = "disabled";
dadada.admin.enable = true; dadada.admin.enable = true;
documentation.enable = true; documentation.enable = true;
@ -139,12 +104,14 @@ in
keyMap = "us"; keyMap = "us";
}; };
} }
)
]; ];
}; };
ninurta = nixosSystem { ninurta = nixosSystem {
nixpkgs = nixpkgs-small; modules = [
extraModules = [ { nixpkgs.pkgs = nixpkgsx86; }
baseModule
./ninurta/configuration.nix ./ninurta/configuration.nix
]; ];
}; };

View file

@ -52,8 +52,6 @@ in
age.secrets."${config.networking.hostName}-backup-passphrase-gs".file = age.secrets."${config.networking.hostName}-backup-passphrase-gs".file =
"${secretsPath}/${config.networking.hostName}-backup-passphrase-gs.age"; "${secretsPath}/${config.networking.hostName}-backup-passphrase-gs.age";
nixpkgs.config.android_sdk.accept_license = true;
programs.ssh.startAgent = true; programs.ssh.startAgent = true;
nix.extraOptions = '' nix.extraOptions = ''
@ -85,7 +83,7 @@ in
networking.hostName = "gorgon"; networking.hostName = "gorgon";
dadada = { dadada = {
steam.enable = true; steam.enable = false;
yubikey.enable = true; yubikey.enable = true;
}; };
@ -154,7 +152,6 @@ in
#]; #];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
android-studio
ghostscript ghostscript
smartmontools smartmontools

View file

@ -1,3 +0,0 @@
{
nixpkgs.config.allowUnfreePredicate = pkg: true;
}

View file

@ -4,6 +4,10 @@ let
initrdHostKey = "${config.networking.hostName}-ssh_host_ed25519_key"; initrdHostKey = "${config.networking.hostName}-ssh_host_ed25519_key";
in in
{ {
imports = [
./server.nix
];
boot.initrd.availableKernelModules = [ "virtio-pci" ]; boot.initrd.availableKernelModules = [ "virtio-pci" ];
boot.kernelParams = [ boot.kernelParams = [

View file

@ -0,0 +1,7 @@
{ pkgs, inputs, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = pkgs.lib.attrValues inputs.self.hmModules;
home-manager.users.dadada = inputs.self.hmConfigurations.dadada;
}

View file

@ -12,11 +12,6 @@
./paperless.nix ./paperless.nix
]; ];
nixpkgs = {
hostPlatform = "x86_64-linux";
config.allowUnfree = true;
};
boot = { boot = {
lanzaboote = { lanzaboote = {
enable = true; enable = true;
@ -58,7 +53,7 @@
# NOTE: hardware.framework.enableKmod requires kernel patching, but enables access to some EC features # NOTE: hardware.framework.enableKmod requires kernel patching, but enables access to some EC features
bluetooth.enable = true; bluetooth.enable = true;
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true; enableRedistributableFirmware = true;
framework.laptop13.audioEnhancement.enable = true; framework.laptop13.audioEnhancement.enable = true;
graphics = { graphics = {
enable = true; enable = true;

View file

@ -1,4 +1,3 @@
# Adapted from Mic92/dotfiles
{ {
self, self,
flake-utils, flake-utils,
@ -11,7 +10,7 @@
(flake-utils.lib.eachDefaultSystem ( (flake-utils.lib.eachDefaultSystem (
system: system:
let let
pkgs = import nixpkgs { inherit system; }; pkgs = nixpkgs.legacyPackages.${system};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in in
{ {
@ -31,20 +30,16 @@
formatter = treefmtEval.config.build.wrapper; formatter = treefmtEval.config.build.wrapper;
packages = import ./pkgs { inherit pkgs; } // { packages = import ./pkgs { inherit pkgs; } // {
installer-iso = self.nixosConfigurations.installer.config.system.build.isoImage; installer-iso = inputs.self.nixosConfigurations.installer.config.system.build.isoImage;
}; };
} }
)) ))
// { // {
hmModules = import ./home/modules.nix { lib = nixpkgs.lib; };
nixosConfigurations = import ./nixos/configurations.nix inputs;
nixosModules = import ./nixos/modules { lib = nixpkgs.lib; };
overlays = import ./overlays.nix;
hydraJobs = import ./hydra-jobs.nix inputs;
checks = import ./checks.nix inputs; checks = import ./checks.nix inputs;
hmModules = import ./home/modules.nix { lib = nixpkgs.lib; };
hmConfigurations = {
dadada = import ./home;
};
nixosConfigurations = import ./nixos/configurations.nix inputs;
nixosModules = import ./nixos/modules { lib = nixpkgs.lib; };
} }

View file

@ -1 +0,0 @@
{ }