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"
}
},
"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": {
"locked": {
"lastModified": 1730741070,
@ -397,7 +381,6 @@
"nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-small": "nixpkgs-small",
"systems": "systems_2",
"treefmt-nix": "treefmt-nix"
}

View file

@ -2,7 +2,6 @@
description = "dadada's nix flake";
inputs = {
nixpkgs-small.url = "github:NixOS/nixpkgs/nixos-unstable-small";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
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
sqlite
sshfs-fuse
steam
taplo
tcpdump
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-generators,
nixpkgs,
nixpkgs-small,
...
}@inputs:
let
nixosSystem =
{
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
# create a new instance allowing some unfree packages
nixpkgsx86 = import nixpkgs {
system = "x86_64-linux";
in
nixosSystem {
inherit nixpkgs system;
extraModules = [
lanzaboote.nixosModules.lanzaboote
disko.nixosModules.disko
{
nixpkgs.overlays = nixpkgs.lib.attrValues self.overlays;
dadada.pkgs = self.packages.${system};
dadada.inputs = inputs // {
dadada = self;
config.allowUnfreePredicate =
pkg:
builtins.elem (nixpkgs.lib.getName pkg) [
"aspell-dict-en-science"
"brgenml1lpr"
"saleae-logic-2"
"spotify"
];
};
}
nixos-hardware.nixosModules.framework-amd-ai-300-series
home-manager.nixosModules.home-manager
nixosSystem = nixpkgs.lib.nixosSystem;
baseModule =
{ lib, ... }:
{
_module.args.inputs = inputs;
imports = [
inputs.agenix.nixosModules.age
inputs.disko.nixosModules.disko
inputs.home-manager.nixosModules.home-manager
(
{ pkgs, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = (nixpkgs.lib.attrValues self.hmModules) ++ [
{ dadada.home.helix.package = pkgs.helix; }
];
home-manager.users.dadada = import ../home;
dadada.homepage.package = homepage;
dadada.pkgs = inputs.self.packages.${pkgs.system};
dadada.inputs = inputs // {
dadada = inputs.self;
};
}
)
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
];
};
gorgon =
let
system = "x86_64-linux";
in
nixosSystem {
inherit nixpkgs system;
extraModules = [
{
nixpkgs.overlays = nixpkgs.lib.attrValues self.overlays;
dadada.pkgs = self.packages.${system};
dadada.inputs = inputs // {
dadada = self;
};
}
gorgon = nixosSystem {
modules = [
{ nixpkgs.pkgs = nixpkgsx86; }
baseModule
nixos-hardware.nixosModules.lenovo-thinkpad-t14s-amd-gen1
home-manager.nixosModules.home-manager
(
{ 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;
}
)
homeModule
./gorgon/configuration.nix
];
};
surgat = nixosSystem {
nixpkgs = nixpkgs-small;
system = "x86_64-linux";
extraModules = [
{
dadada.homepage.package = homepage;
}
./modules/profiles/server.nix
modules = [
{ nixpkgs.pkgs = nixpkgsx86; }
baseModule
./surgat/configuration.nix
];
};
agares = nixosSystem {
nixpkgs = nixpkgs-small;
extraModules = [
modules = [
{ nixpkgs.pkgs = nixpkgsx86; }
baseModule
./agares/configuration.nix
];
};
installer =
let
nixpkgs = nixpkgs-small;
in
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
installer = nixosSystem {
modules = [
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";
dadada.admin.enable = true;
documentation.enable = true;
@ -139,12 +104,14 @@ in
keyMap = "us";
};
}
)
];
};
ninurta = nixosSystem {
nixpkgs = nixpkgs-small;
extraModules = [
modules = [
{ nixpkgs.pkgs = nixpkgsx86; }
baseModule
./ninurta/configuration.nix
];
};

View file

@ -52,8 +52,6 @@ in
age.secrets."${config.networking.hostName}-backup-passphrase-gs".file =
"${secretsPath}/${config.networking.hostName}-backup-passphrase-gs.age";
nixpkgs.config.android_sdk.accept_license = true;
programs.ssh.startAgent = true;
nix.extraOptions = ''
@ -85,7 +83,7 @@ in
networking.hostName = "gorgon";
dadada = {
steam.enable = true;
steam.enable = false;
yubikey.enable = true;
};
@ -154,7 +152,6 @@ in
#];
environment.systemPackages = with pkgs; [
android-studio
ghostscript
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";
in
{
imports = [
./server.nix
];
boot.initrd.availableKernelModules = [ "virtio-pci" ];
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
];
nixpkgs = {
hostPlatform = "x86_64-linux";
config.allowUnfree = true;
};
boot = {
lanzaboote = {
enable = true;
@ -58,7 +53,7 @@
# NOTE: hardware.framework.enableKmod requires kernel patching, but enables access to some EC features
bluetooth.enable = true;
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
enableAllFirmware = true;
enableRedistributableFirmware = true;
framework.laptop13.audioEnhancement.enable = true;
graphics = {
enable = true;

View file

@ -1,4 +1,3 @@
# Adapted from Mic92/dotfiles
{
self,
flake-utils,
@ -11,7 +10,7 @@
(flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
pkgs = nixpkgs.legacyPackages.${system};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
@ -31,20 +30,16 @@
formatter = treefmtEval.config.build.wrapper;
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;
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 @@
{ }