nix_config/flake.nix

69 lines
1.8 KiB
Nix

{
description = "NixOS configurations for my machines";
inputs = {
nixpkgs.url = "nixpkgs/23.11";
nixos-hardware = {
url = github:nixos/nixos-hardware;
};
home-manager = {
# url = github:nix-community/home-manager;
url = github:nix-community/home-manager/6a8444467c83c961e2f5ff64fb4f422e303c98d3;
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = github:Mic92/sops-nix;
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
nixos-hardware,
home-manager,
sops-nix,
...
}: let
system = "x86_64-linux";
homeManagerConfFor = config: { ... }: {
imports = [ config ];
};
jacobHome = homeManagerConfFor ./home/jacob.nix;
jacobHomeMod = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.jacob = jacobHome;
};
};
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
jacobHomeMod
sops-nix.nixosModules.sops
] ++ extraModules;
};
in {
homeManagerConfigurations = {
jacob = jacobHome;
};
nixosConfigurations = {
# Thinkpad T470 laptop
buck = mkNixosSystem [
nixos-hardware.nixosModules.lenovo-thinkpad-t470s
./machines/buck/configuration.nix
];
# ThinkCentre M700 mini-pc (server)
cj = mkNixosSystem [
nixos-hardware.nixosModules.common-pc-hdd
nixos-hardware.nixosModules.common-cpu-intel-cpu-only
./machines/cj/configuration.nix
];
};
};
}