Split rubusidaeus config + split user and git config

This commit is contained in:
Ivan Bushchik 2023-09-01 07:13:07 +03:00
parent c5cfec0c98
commit 35cf2d2a39
No known key found for this signature in database
GPG key ID: 2F16FBF3262E090C
9 changed files with 67 additions and 39 deletions

View file

@ -1,6 +1,7 @@
{ {
imports = [ imports = [
./base.nix ./base.nix
./git.nix
./laptop.nix ./laptop.nix
./locale.nix ./locale.nix
./networking.nix ./networking.nix

25
common/git.nix Normal file
View file

@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
let
cfg = config.my.git;
in {
options = {
my.git.enable = lib.mkEnableOption "Enable git configuration";
};
config = lib.mkIf (cfg.enable) {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.ivabus = {
programs.git = {
enable = true;
userName = "Ivan Bushchik";
userEmail = "ivabus@ivabus.dev";
signing.key = "2F16FBF3262E090C";
signing.signByDefault = true;
package = pkgs.gitAndTools.gitFull;
};
home.stateVersion = "23.05";
};
};
}

View file

@ -48,15 +48,4 @@ in rec {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.ivabus = {
programs.git = {
enable = true;
userName = "Ivan Bushchik";
userEmail = "ivabus@ivabus.dev";
signing.key = "2F16FBF3262E090C";
signing.signByDefault = true;
package = pkgs.gitAndTools.gitFull;
};
home.stateVersion = "23.05";
};
} }

35
hardware/rpi4.nix Normal file
View file

@ -0,0 +1,35 @@
{ config, pkgs, lib, ... }:
let
overlay = final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; }); # Ignores missing kernel modules (can't build image without this fix)
};
in {
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
sdImage.compressImage = false;
# Augghhh (activates fix)
nixpkgs.overlays = [ overlay ];
hardware.enableRedistributableFirmware = true;
}

View file

@ -16,6 +16,7 @@ in {
boot.kernelParams = [ "apple_dcp.show_notch=1" ]; boot.kernelParams = [ "apple_dcp.show_notch=1" ];
my.laptop.enable = true; my.laptop.enable = true;
my.git.enable = true;
my.roles = { my.roles = {
design.enable = true; design.enable = true;
devel.enable = true; devel.enable = true;

View file

@ -17,6 +17,7 @@ in {
# All "my" options # All "my" options
my.laptop.enable = true; my.laptop.enable = true;
my.git.enable = true;
my.roles = { my.roles = {
design.enable = true; design.enable = true;
devel.enable = true; devel.enable = true;

View file

@ -3,38 +3,16 @@
let let
my = import ../..; my = import ../..;
overlay = final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
};
in { in {
imports = [ imports = [
# Not using ./hardware.nix as additional hardware file due to generation of images that doesn't change between installations. Maybe I should create dedicated raspberry.nix for all raspberry pies.
my.modules my.modules
../../hardware/rpi4.nix
]; ];
boot = {
kernelPackages = pkgs.linuxKernel.packages.linux_rpi4;
initrd.availableKernelModules = [ "xhci_pci" "usbhid" "usb_storage" ];
loader = {
grub.enable = false;
generic-extlinux-compatible.enable = true;
};
};
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
sdImage.compressImage = false;
networking.hostName = "rubusidaeus"; networking.hostName = "rubusidaeus";
my.laptop.enable = false; my.laptop.enable = false;
my.git.enable = false;
my.roles = { my.roles = {
design.enable = false; design.enable = false;
devel.enable = false; devel.enable = false;
@ -47,10 +25,6 @@ in {
yggdrasil-client.enable = true; yggdrasil-client.enable = true;
}; };
# Augghhh
nixpkgs.overlays = [ overlay ];
networking.useDHCP = true; networking.useDHCP = true;
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;

View file

@ -15,6 +15,7 @@ in {
networking.hostName = "stella"; networking.hostName = "stella";
my.laptop.enable = true; my.laptop.enable = true;
my.git.enable = true;
my.roles = { my.roles = {
design.enable = true; design.enable = true;
devel.enable = true; devel.enable = true;

View file

@ -15,6 +15,7 @@ in {
networking.hostName = "vetus"; networking.hostName = "vetus";
my.laptop.enable = false; my.laptop.enable = false;
my.git.enable = true;
my.roles = { my.roles = {
design.enable = true; design.enable = true;
devel.enable = true; devel.enable = true;