Create mkNixosSystem and pin nixpkgs on pedro

This commit is contained in:
Jacob Hinkle 2022-10-13 08:40:52 -04:00
parent f805c215cc
commit 7fa9ec19c4
2 changed files with 31 additions and 30 deletions

View File

@ -19,36 +19,31 @@
#nixpkgs.overlays = [ nur.overlay ];
imports = [ config ];
};
in {
nixosConfigurations = {
# Thinkpad T470 laptop
buck = nixpkgs.lib.nixosSystem {
mkNixosSystem = extraModules: nixpkgs.lib.nixosSystem {
inherit system;
# see https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html
specialArgs = { inherit inputs; };
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-t470s
./machines/buck/configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useUserPackages = true;
home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix;
}
sops-nix.nixosModules.sops
];
] ++ extraModules;
};
in {
nixosConfigurations = {
# Thinkpad T470 laptop
buck = mkNixosSystem [
nixos-hardware.nixosModules.lenovo-thinkpad-t470s
./machines/buck/configuration.nix
];
# ThinkCentre M700 mini-pc (server)
pedro = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
pedro = mkNixosSystem [
nixos-hardware.nixosModules.common-pc-hdd
nixos-hardware.nixosModules.common-cpu-intel-cpu-only
./machines/pedro/configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useUserPackages = true;
home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix;
}
sops-nix.nixosModules.sops
];
};
};
};
}

View File

@ -1,12 +1,18 @@
# Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, options, sops, ... }:
{ config, pkgs, inputs, options, sops, ... }:
{ imports =
[ # Include the results of the hardware scan.
./hardware-configuration-zfs.nix
];
# This lets us pin the nixpkgs registry by default to the nixpkgs used to build this system.
# Doing this means we are less likely to require the 30+MB download when
# running commands like nix search or nix run
# See: https://dataswamp.org/~solene/2022-07-20-nixos-flakes-command-sync-with-system.html
nix.registry.nixpkgs.flake = inputs.nixpkgs;
sops = {
# This will add secrets.yml to the nix store
# You can avoid this by adding a string to the full path instead, i.e.