feat: init system & nix modules

This commit is contained in:
notohh 2023-04-22 03:21:08 -04:00
parent b7d69e9fd0
commit 244c66c51c
Signed by: notohh
GPG key ID: BD47506D475EE86D
8 changed files with 87 additions and 127 deletions

View file

@ -20,23 +20,7 @@
networking = { networking = {
hostName = "hime"; hostName = "hime";
}; };
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
services.xserver = { services.xserver = {
layout = "us"; layout = "us";
xkbVariant = ""; xkbVariant = "";
@ -49,10 +33,6 @@
}; };
}; };
services.fstrim = {
enable = true;
};
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
users ={ users ={
defaultUserShell = pkgs.nushell; defaultUserShell = pkgs.nushell;
@ -67,7 +47,6 @@
}; };
}; };
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
docker-compose docker-compose
@ -76,19 +55,4 @@
nfs-utils nfs-utils
]; ];
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
settings.auto-optimise-store = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
system.stateVersion = "23.05";
} }

View file

@ -20,22 +20,6 @@
hostName = "sutakku"; hostName = "sutakku";
}; };
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
services.xserver = { services.xserver = {
layout = "us"; layout = "us";
xkbVariant = ""; xkbVariant = "";
@ -50,7 +34,6 @@
extraGroups = [ "networkmanager" "wheel" ]; extraGroups = [ "networkmanager" "wheel" ];
}; };
}; };
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget wget
@ -65,20 +48,4 @@
}; };
services.openssh.enable = true; services.openssh.enable = true;
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
settings.auto-optimise-store = true;
gc = {
automatic = true;
dates = "weekly";
options = "delete-older-than 7d";
};
};
system.stateVersion = "23.05";
} }

View file

@ -33,26 +33,7 @@
hostName = "tsuki"; hostName = "tsuki";
}; };
time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
services = { services = {
fstrim = {
enable = true;
};
xserver = { xserver = {
enable = true; enable = true;
videoDrivers = [ "nvidia" ]; videoDrivers = [ "nvidia" ];
@ -144,40 +125,4 @@
nodePackages_latest.yaml-language-server nodePackages_latest.yaml-language-server
python310Packages.python-lsp-server python310Packages.python-lsp-server
]; ];
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
settings = {
auto-optimise-store = true;
builders-use-substitutes = true;
substituters = [
"https://hyprland.cachix.org"
"https://cache.nixos.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
};
nixpkgs.config = {
permittedInsecurePackages = [
"qtwebkit-5.212.0-alpha4"
"electron-12.2.3"
];
allowUnfree = true;
};
system.stateVersion = "23.05";
} }

View file

@ -8,6 +8,8 @@ name | description
`fonts` | font handling `fonts` | font handling
`greetd` | login manager `greetd` | login manager
`networking` | common network configuration `networking` | common network configuration
`nix` | common nix configuration
`security` | stolen from [hlissner](https://github.com/hlissner) `security` | stolen from [hlissner](https://github.com/hlissner)
`swayidle` | idle manager daemon `swayidle` | idle manager daemon
`system.nix` | commonly shared system settings
`udevd` | fixes an issue when using `nixos-rebuild`, tracked [here](https://github.com/NixOS/nixpkgs/issues/180175) `udevd` | fixes an issue when using `nixos-rebuild`, tracked [here](https://github.com/NixOS/nixpkgs/issues/180175)

View file

@ -5,5 +5,7 @@
./security.nix ./security.nix
./udevd.nix ./udevd.nix
./networking.nix ./networking.nix
./nix.nix
./system.nix
]; ];
} }

View file

@ -3,13 +3,13 @@
}: { }: {
networking = { networking = {
networkmanager.enable = true; networkmanager.enable = true;
nameservers = [ "1.1.1.1" ]; nameservers = [ "192.168.1.89" ];
firewall = { firewall = {
enable = true; enable = true;
}; };
}; };
environment.etc = { environment.etc = {
"resolv.conf".text = "nameserver 1.1.1.1\n"; "resolv.conf".text = "nameserver 192.168.1.89\n";
}; };
services.tailscale = { services.tailscale = {

46
modules/nix.nix Normal file
View file

@ -0,0 +1,46 @@
{
pkgs,
...
}: {
nixpkgs = {
config = {
allowUnfree = true;
permittedInsecurePackages = [
"qtwebkit-5.212.0-alpha4"
"electron-12.2.3"
];
};
};
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
settings = {
auto-optimise-store = true;
builders-use-substitutes = true;
keep-derivations = true;
keep-outputs = true;
substituters = [
"https://hyprland.cachix.org"
"https://cache.nixos.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
};
system.autoUpgrade.enable = false;
system.stateVersion = "23.05"; # no touchy
}

34
modules/system.nix Normal file
View file

@ -0,0 +1,34 @@
{
...
}: {
documentation = {
enable = true;
doc.enable = false;
man.enable = true;
dev.enable = false;
};
services = {
fstrim = {
enable = true;
};
};
time.timeZone = "America/New_York";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
}