2024-04-18 20:39:32 +01:00
|
|
|
{
|
2024-06-26 16:07:44 +01:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
|
|
};
|
2024-04-18 20:39:32 +01:00
|
|
|
outputs = { self, nixpkgs }: {
|
|
|
|
# miscellaneous stuff that's important
|
|
|
|
nixosModules.base = {lib, ...}: {
|
|
|
|
boot.swraid.enable = lib.mkForce false;
|
|
|
|
networking.hostName = "chopper";
|
|
|
|
networking.firewall.enable = true;
|
|
|
|
system.stateVersion = "24.05";
|
2024-05-04 12:51:43 +01:00
|
|
|
sdImage.firmwarePartitionOffset = 32;
|
2024-05-04 13:37:58 +01:00
|
|
|
nix.settings = {
|
|
|
|
extra-experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
};
|
2024-04-18 20:39:32 +01:00
|
|
|
};
|
|
|
|
# Configuration of individual users
|
|
|
|
nixosModules.users = {...}: {
|
2024-05-31 17:24:04 +01:00
|
|
|
users.users = {
|
|
|
|
taneb = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIV9ymP4tpq11a8wfUvn8eEEwAPvZZSPZTbASLh7YxOw nvd1234@gmail.com"
|
|
|
|
];
|
|
|
|
hashedPassword = "$y$j9T$9pxQ4Zj7OirGMmgclhUb0/$YCfaYmIaaHRrkqiqdNbQSlJ7puX8bGrMCLavq6Pe1e3";
|
2024-06-01 12:04:12 +01:00
|
|
|
};
|
|
|
|
nairis = {
|
|
|
|
isNormalUser = true;
|
|
|
|
hashedPassword = "$y$j9T$luA6OU3OWVXbJc6DZM4Fx1$nTc89zTdKgozwR5kZQglbWaCkOFtmNZcpO4WCcYYPZC";
|
|
|
|
};
|
2024-04-18 20:39:32 +01:00
|
|
|
};
|
|
|
|
users.mutableUsers = false;
|
|
|
|
};
|
|
|
|
# Configuration of SSH server
|
|
|
|
nixosModules.ssh = {...}: {
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
settings.PasswordAuthentication = false;
|
|
|
|
};
|
|
|
|
};
|
2024-05-04 15:33:24 +01:00
|
|
|
nixosModules.zfs = {...}: {
|
|
|
|
boot.supportedFilesystems = [ "zfs" ];
|
|
|
|
boot.zfs.forceImportRoot = false;
|
|
|
|
boot.zfs.extraPools = [ "storage" ];
|
|
|
|
# zfs needs this for some reason
|
|
|
|
networking.hostId = "488ecad2";
|
|
|
|
};
|
2024-05-09 07:58:18 +01:00
|
|
|
nixosModules.plex = {...}: {
|
|
|
|
services.plex = {
|
|
|
|
enable = true;
|
2024-06-01 12:04:12 +01:00
|
|
|
dataDir = "/storage/data";
|
|
|
|
openFirewall = true;
|
2024-05-09 07:58:18 +01:00
|
|
|
};
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
};
|
2024-06-26 16:09:19 +01:00
|
|
|
nixosModules.hledger = {...}: {
|
|
|
|
services.hledger-web = {
|
|
|
|
enable = true;
|
|
|
|
allow = "edit";
|
2024-06-29 06:54:54 +01:00
|
|
|
host = "0.0.0.0";
|
|
|
|
baseUrl = "http://192.168.1.37:5000";
|
2024-06-26 16:09:19 +01:00
|
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [ 5000 ];
|
|
|
|
};
|
2024-06-01 12:04:12 +01:00
|
|
|
nixosModules.samba = {...}: {
|
|
|
|
services.samba = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
2024-09-19 20:09:38 +01:00
|
|
|
settings = {
|
2024-06-01 12:04:12 +01:00
|
|
|
chopper = {
|
|
|
|
path = "/storage/media";
|
|
|
|
browseable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "no";
|
|
|
|
"inherit permissions" = "yes";
|
|
|
|
"create mask" = "0666";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services.samba-wsdd = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
};
|
2024-04-18 20:39:32 +01:00
|
|
|
nixosConfigurations.chopper = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "aarch64-linux";
|
|
|
|
modules = [
|
|
|
|
(nixpkgs + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix")
|
|
|
|
self.nixosModules.base
|
|
|
|
self.nixosModules.users
|
|
|
|
self.nixosModules.ssh
|
2024-06-01 12:04:12 +01:00
|
|
|
self.nixosModules.zfs
|
|
|
|
self.nixosModules.plex
|
|
|
|
self.nixosModules.samba
|
2024-06-26 16:09:19 +01:00
|
|
|
self.nixosModules.hledger
|
2024-04-18 20:39:32 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|