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