1{ 2 pkgs, 3 config, 4 lib, 5 agenix, 6 ... 7}: 8 9let 10 cfg = config.custom; 11in 12{ 13 imports = [ 14 ./auto-upgrade.nix 15 ./dict.nix 16 ./external-hdd-backup.nix 17 ./freumh.nix 18 ./gui/default.nix 19 ./gui/i3.nix 20 ./gui/kde.nix 21 ./gui/sway.nix 22 ./home-manager.nix 23 ./laptop.nix 24 ./nix-cache.nix 25 ./nix-index.nix 26 ./ocaml.nix 27 ./printing.nix 28 ./rmfakecloud.nix 29 ./scripts.nix 30 ./ssh.nix 31 ./tailscale.nix 32 ./use-nix-cache.nix 33 ./workstation.nix 34 ./zsa.nix 35 ]; 36 37 options.custom = { 38 enable = lib.mkEnableOption "custom"; 39 username = lib.mkOption { 40 type = lib.types.str; 41 default = "ryan"; 42 }; 43 }; 44 45 config = 46 let 47 nixPath = "/etc/nix-path"; 48 in 49 lib.mkIf cfg.enable { 50 console = { 51 font = "Lat2-Terminus16"; 52 keyMap = "uk"; 53 }; 54 i18n.defaultLocale = "en_GB.UTF-8"; 55 56 networking.domain = lib.mkDefault "freumh.org"; 57 58 eilean.username = cfg.username; 59 60 nix = { 61 settings = lib.mkMerge [ 62 { 63 experimental-features = [ 64 "nix-command" 65 "flakes" 66 ]; 67 auto-optimise-store = true; 68 trusted-users = [ cfg.username ]; 69 } 70 ]; 71 gc = { 72 automatic = true; 73 dates = "weekly"; 74 options = "--delete-older-than 30d"; 75 }; 76 # https://discourse.nixos.org/t/do-flakes-also-set-the-system-channel/19798/16 77 nixPath = [ "nixpkgs=${nixPath}" ]; 78 }; 79 systemd.tmpfiles.rules = [ "L+ ${nixPath} - - - - ${pkgs.path}" ]; 80 81 users = 82 let 83 hashedPassword = "$6$IPvnJnu6/fp1Jxfy$U6EnzYDOC2NqE4iqRrkJJbSTHHNWk0KwK1xyk9jEvlu584UWQLyzDVF5I1Sh47wQhSVrvUI4mrqw6XTTjfPj6."; 84 in 85 { 86 mutableUsers = false; 87 groups.plugdev = { }; 88 users.${cfg.username} = { 89 isNormalUser = true; 90 extraGroups = [ 91 "wheel" # enable sudo 92 "networkmanager" 93 "video" 94 "plugdev" 95 ]; 96 shell = pkgs.zsh; 97 # we let home manager manager zsh 98 ignoreShellProgramCheck = true; 99 hashedPassword = hashedPassword; 100 }; 101 users.root.hashedPassword = hashedPassword; 102 }; 103 104 environment.systemPackages = with pkgs; [ 105 nix 106 git 107 agenix.packages.${system}.default 108 ]; 109 110 networking = rec { 111 # nameservers = [ "freumh.org" ]; 112 nameservers = [ "1.1.1.1" ]; 113 # uncomment to stop using DHCP nameservers 114 #networkmanager.dns = "none"; 115 }; 116 }; 117}