Compare commits

...

2 Commits

Author SHA1 Message Date
jolheiser 08c39b6601
chore: clean up flake
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2024-04-03 21:36:13 -05:00
jolheiser 6a5f3da703
feat: split hm from system
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2024-04-03 20:38:55 -05:00
3 changed files with 145 additions and 121 deletions

View File

@ -3,6 +3,7 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils"; # Only expressed here to use for followers
nixpkgs-py39.url = "github:nixos/nixpkgs/f294325aed382b66c7a188482101b0f336d1d7db";
home-manager = {
@ -17,7 +18,6 @@
home-manager.follows = "";
};
};
flake-utils.url = "github:numtide/flake-utils";
nixos-hardware.url = "github:nixos/nixos-hardware/master";
nur.url = "github:nix-community/NUR";
@ -124,28 +124,21 @@
})
inputs.golink.overlay
];
pkgs = import nixpkgs {
inherit overlays system;
config.allowUnfree = true;
};
userSecret = path: {
file = path;
owner = username;
};
commonConfig = {gui ? true}: {config, ...}: {
commonConfig = {config, ...}: {
config = {
nixpkgs.overlays = overlays;
# TODO Remove when apps are updated
nixpkgs.config.permittedInsecurePackages = [
"electron-25.9.0"
];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.${username}.imports =
if gui
then [./apps/gui]
else [./apps/nogui];
extraSpecialArgs = {
flakePath = "/home/${username}/.config/nixpkgs";
};
};
age.secrets = {
ssh-config = userSecret ./secrets/shared/ssh-config.age;
ssh-config-work = userSecret ./secrets/shared/ssh-config-work.age;
@ -166,9 +159,8 @@
};
};
workModules = [
home-manager.nixosModules.home-manager
agenix.nixosModules.default
(commonConfig {})
commonConfig
({pkgs, ...}: {
config = {
nixpkgs.overlays = [
@ -176,10 +168,6 @@
py39 = import nixpkgs-py39 {inherit (pkgs) system;};
})
];
home-manager.users.${username}.programs = {
git.package = pkgs.gitSVN;
firefox.profiles.default.bookmarks = [(import ./apps/gui/firefox/work.nix)];
};
age.secrets = {
netrc = {
file = ./secrets/work/netrc.age;
@ -202,11 +190,45 @@
})
];
username = "jolheiser";
in
system = "x86_64-linux";
in {
homeConfigurations = let
commonModules = [
{
home = {
inherit username;
homeDirectory = "/home/${username}";
};
}
./apps/gui
];
in {
"jolheiser" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = commonModules;
};
"work" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules =
commonModules
++ [
{
nixpkgs.overlays = [
(_: _: {
py39 = import nixpkgs-py39 {inherit (pkgs) system;};
})
];
programs = {
git.package = pkgs.gitSVN;
firefox.profiles.default.bookmarks = [(import ./apps/gui/firefox/work.nix)];
};
}
];
};
};
nixosConfigurations = {
"chai" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
modules =
workModules
++ [
@ -214,7 +236,7 @@
];
};
"earlgrey" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
modules =
workModules
++ [
@ -222,7 +244,7 @@
];
};
"masala" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
modules =
workModules
++ [
@ -231,39 +253,35 @@
];
};
"matcha" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
modules = [
home-manager.nixosModules.home-manager
agenix.nixosModules.default
./machines/matcha
(commonConfig {})
commonConfig
];
};
"genmaicha" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
modules = [
home-manager.nixosModules.home-manager
nixos-hardware.nixosModules.framework-13-7040-amd
agenix.nixosModules.default
./machines/genmaicha
(commonConfig {})
commonConfig
];
};
"sencha" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
modules = [
home-manager.nixosModules.home-manager
agenix.nixosModules.default
./machines/sencha
(commonConfig {})
commonConfig
];
};
};
colmena = {
meta = {
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = overlays;
inherit overlays system;
};
};
dragonwell = {
@ -279,15 +297,11 @@
extra-substitutors = ["https://jolheiser.cachix.org"];
extra-trusted-public-keys = ["jolheiser.cachix.org-1:fiKkfTuHFqDK5ZOVxcqb4InUkKsrTvtMLISid7XvuVg="];
};
}
// inputs.flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
devShells.${system}.default = pkgs.mkShell {
nativeBuildInputs = [
agenix.packages.${system}.agenix
pkgs.colmena
];
};
});
};
}

View File

@ -11,6 +11,12 @@ rebuild *args:
switch *args:
@just rebuild switch {{args}}
hm:
@home-manager switch --flake .
work:
@home-manager switch --flake '.#work'
# Rebuild the current machine for next boot
boot *args:
@just rebuild boot {{args}}

View File

@ -1,31 +1,35 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix") ../common/cifs.nix
config,
lib,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
../common/cifs.nix
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-amd"];
boot.extraModulePackages = [];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/e2274508-9989-4f6b-9bcf-a0d246f292f9";
fileSystems."/" = {
device = "/dev/disk/by-uuid/e2274508-9989-4f6b-9bcf-a0d246f292f9";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-1121cd25-7c4c-47ee-b04a-2cab0cd251ea".device = "/dev/disk/by-uuid/1121cd25-7c4c-47ee-b04a-2cab0cd251ea";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/86CA-6DF6";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/86CA-6DF6";
fsType = "vfat";
};
swapDevices = [ ];
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's