diff --git a/common/default.nix b/common/default.nix index c96f7fe..28ddaa4 100644 --- a/common/default.nix +++ b/common/default.nix @@ -1,6 +1,7 @@ { imports = [ ./base.nix + ./git.nix ./laptop.nix ./locale.nix ./networking.nix diff --git a/common/git.nix b/common/git.nix new file mode 100644 index 0000000..a40fef2 --- /dev/null +++ b/common/git.nix @@ -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"; + }; + }; +} \ No newline at end of file diff --git a/common/user.nix b/common/user.nix index ee645d6..c7b24dd 100644 --- a/common/user.nix +++ b/common/user.nix @@ -48,15 +48,4 @@ in rec { 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"; - }; } diff --git a/hardware/rpi4.nix b/hardware/rpi4.nix new file mode 100644 index 0000000..8eedd4b --- /dev/null +++ b/hardware/rpi4.nix @@ -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; +} + diff --git a/machines/celerrime/default.nix b/machines/celerrime/default.nix index 89b32d2..693f6b9 100644 --- a/machines/celerrime/default.nix +++ b/machines/celerrime/default.nix @@ -16,6 +16,7 @@ in { boot.kernelParams = [ "apple_dcp.show_notch=1" ]; my.laptop.enable = true; + my.git.enable = true; my.roles = { design.enable = true; devel.enable = true; diff --git a/machines/example/default.nix b/machines/example/default.nix index 9faa575..3927a4f 100644 --- a/machines/example/default.nix +++ b/machines/example/default.nix @@ -17,6 +17,7 @@ in { # All "my" options my.laptop.enable = true; + my.git.enable = true; my.roles = { design.enable = true; devel.enable = true; diff --git a/machines/rubusidaeus/default.nix b/machines/rubusidaeus/default.nix index 498a57f..fa3bbbd 100644 --- a/machines/rubusidaeus/default.nix +++ b/machines/rubusidaeus/default.nix @@ -3,38 +3,16 @@ let my = import ../..; - overlay = final: super: { - makeModulesClosure = x: - super.makeModulesClosure (x // { allowMissing = true; }); - }; in { 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 + ../../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"; my.laptop.enable = false; + my.git.enable = false; my.roles = { design.enable = false; devel.enable = false; @@ -47,10 +25,6 @@ in { yggdrasil-client.enable = true; }; - # Augghhh - - nixpkgs.overlays = [ overlay ]; - networking.useDHCP = true; hardware.enableRedistributableFirmware = true; diff --git a/machines/stella/default.nix b/machines/stella/default.nix index fbd1430..4963a70 100644 --- a/machines/stella/default.nix +++ b/machines/stella/default.nix @@ -15,6 +15,7 @@ in { networking.hostName = "stella"; my.laptop.enable = true; + my.git.enable = true; my.roles = { design.enable = true; devel.enable = true; diff --git a/machines/vetus/default.nix b/machines/vetus/default.nix index 9e08074..aafd03c 100644 --- a/machines/vetus/default.nix +++ b/machines/vetus/default.nix @@ -15,6 +15,7 @@ in { networking.hostName = "vetus"; my.laptop.enable = false; + my.git.enable = true; my.roles = { design.enable = true; devel.enable = true;