Create mkNixosSystem and pin nixpkgs on pedro
This commit is contained in:
parent
f805c215cc
commit
7fa9ec19c4
53
flake.nix
53
flake.nix
@ -16,39 +16,34 @@
|
|||||||
let
|
let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
homeManagerConfFor = config: { ... }: {
|
homeManagerConfFor = config: { ... }: {
|
||||||
#nixpkgs.overlays = [ nur.overlay ];
|
#nixpkgs.overlays = [ nur.overlay ];
|
||||||
imports = [ config ];
|
imports = [ config ];
|
||||||
};
|
};
|
||||||
|
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 = [
|
||||||
|
home-manager.nixosModules.home-manager {
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.jacob = homeManagerConfFor ./home/jacob.nix;
|
||||||
|
}
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
] ++ extraModules;
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
# Thinkpad T470 laptop
|
# Thinkpad T470 laptop
|
||||||
buck = nixpkgs.lib.nixosSystem {
|
buck = mkNixosSystem [
|
||||||
inherit system;
|
nixos-hardware.nixosModules.lenovo-thinkpad-t470s
|
||||||
modules = [
|
./machines/buck/configuration.nix
|
||||||
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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
# ThinkCentre M700 mini-pc (server)
|
# ThinkCentre M700 mini-pc (server)
|
||||||
pedro = nixpkgs.lib.nixosSystem {
|
pedro = mkNixosSystem [
|
||||||
inherit system;
|
nixos-hardware.nixosModules.common-pc-hdd
|
||||||
modules = [
|
nixos-hardware.nixosModules.common-cpu-intel-cpu-only
|
||||||
nixos-hardware.nixosModules.common-pc-hdd
|
./machines/pedro/configuration.nix
|
||||||
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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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’).
|
# 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 =
|
{ imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware-configuration-zfs.nix
|
./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 = {
|
sops = {
|
||||||
# This will add secrets.yml to the nix store
|
# This will add secrets.yml to the nix store
|
||||||
# You can avoid this by adding a string to the full path instead, i.e.
|
# You can avoid this by adding a string to the full path instead, i.e.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user