❄️ Nix configurations

add git and gpg

Alex Ottr 6d395c18 d93feabb

+73 -27
+11 -18
hosts/otter/configuration.nix
··· 1 - { config, pkgs, ... }: 1 + { config, lib, pkgs, ... }: 2 2 3 3 { 4 4 imports = 5 5 [ # Include the results of the hardware scan. 6 6 ./hardware-configuration.nix 7 + ../../modules/nixos/common/i18n.nix 8 + ../../modules/nixos/common/gpg.nix 7 9 ]; 8 10 9 11 # Bootloader. ··· 14 16 boot.kernelPackages = pkgs.linuxPackages_latest; 15 17 16 18 boot.initrd.luks.devices."luks-7736f743-324d-43d9-b3ad-5ddd3b3bd0e0".device = "/dev/disk/by-uuid/7736f743-324d-43d9-b3ad-5ddd3b3bd0e0"; 17 - networking.hostName = "otter"; # Define your hostname. 19 + 20 + networking = { 21 + hostName = "otter"; 22 + networkmanager.enable = true; 23 + domain = "otter.place"; 24 + useDHCP = lib.mkDefault true; 25 + }; 26 + 18 27 # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 19 28 20 29 # Configure network proxy if necessary 21 30 # networking.proxy.default = "http://user:password@proxy:port/"; 22 31 # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; 23 32 24 - # Enable networking 25 - networking.networkmanager.enable = true; 26 33 27 34 # Set your time zone. 28 35 time.timeZone = "Europe/Paris"; 29 36 30 - # Select internationalisation properties. 31 - i18n.defaultLocale = "en_US.UTF-8"; 32 - 33 - i18n.extraLocaleSettings = { 34 - LC_ADDRESS = "fr_FR.UTF-8"; 35 - LC_IDENTIFICATION = "fr_FR.UTF-8"; 36 - LC_MEASUREMENT = "fr_FR.UTF-8"; 37 - LC_MONETARY = "fr_FR.UTF-8"; 38 - LC_NAME = "fr_FR.UTF-8"; 39 - LC_NUMERIC = "fr_FR.UTF-8"; 40 - LC_PAPER = "fr_FR.UTF-8"; 41 - LC_TELEPHONE = "fr_FR.UTF-8"; 42 - LC_TIME = "fr_FR.UTF-8"; 43 - }; 44 37 45 38 # Enable the X11 windowing system. 46 39 # You can disable this if you're only using the Wayland session.
+4 -9
hosts/otter/hardware-configuration.nix
··· 10 10 boot.kernelModules = [ "kvm-amd" ]; 11 11 boot.extraModulePackages = [ ]; 12 12 13 - powerManagement.cpuFreqGovernor = "powersave"; 13 + # powerManagement = { 14 + # cpuFreqGovernor = "powersave"; 15 + # powertop.enable = true; 16 + # }; 14 17 15 18 fileSystems."/" = 16 19 { device = "/dev/disk/by-uuid/9b07d71e-c941-4369-97d7-eb2d8b223508"; ··· 28 31 swapDevices = 29 32 [ { device = "/dev/disk/by-uuid/8e8176f7-0b19-4fed-8ddf-721cc27abe2f"; } 30 33 ]; 31 - 32 - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking 33 - # (the default) this is the recommended approach. When using systemd-networkd it's 34 - # still possible to use this option, but it's recommended to use it in conjunction 35 - # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. 36 - networking.useDHCP = lib.mkDefault true; 37 - # networking.interfaces.enp193s0f3u1.useDHCP = lib.mkDefault true; 38 - # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; 39 34 40 35 nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; 41 36 hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+1
hosts/otter/home.nix
··· 7 7 8 8 imports = [ 9 9 ../../modules/home-manager/vscode.nix 10 + ../../modules/home-manager/git.nix 10 11 ]; 11 12 12 13 home.packages = [];
+45
modules/home-manager/git.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: { 7 + 8 + programs.fish.shellAbbrs = { 9 + g = "git"; 10 + ga = "git add"; 11 + gcm = "git commit -sm"; 12 + gp = "git push"; 13 + gpl = "git pull"; 14 + gr = "git rebase"; 15 + gs = "git status"; 16 + }; 17 + 18 + 19 + programs.gh = { 20 + enable = true; 21 + settings = { 22 + version = "1"; 23 + git_protocol = "ssh"; 24 + }; 25 + }; 26 + 27 + programs.git = { 28 + enable = true; 29 + 30 + userName = "Alex Ottr"; 31 + userEmail = "alex@otter.foo"; 32 + signing = { 33 + key = "B899892A9D13D8A761B5F3E0E3DC722E2943A517"; 34 + signByDefault = true; 35 + }; 36 + 37 + extraConfig = { 38 + init.defaultBranch = "main"; 39 + pull.rebase = true; 40 + rerere.enabled = true; 41 + 42 + tag.gpgSign = false; 43 + }; 44 + }; 45 + }
+12
modules/nixos/common/gpg.nix
··· 1 + {...}: { 2 + programs.gnupg.agent = { 3 + enable = true; 4 + enableSSHSupport = true; 5 + settings = { 6 + default-cache-ttl = 1209600; 7 + default-cache-ttl-ssh = 1209600; 8 + max-cache-ttl = 1209600; 9 + max-cache-ttl-ssh = 1209600; 10 + }; 11 + }; 12 + }