refactoring for isServer and isWorkstation: part 5 (final?)

This commit is contained in:
William 2025-03-13 17:51:04 -03:00
parent a52ca12286
commit 037d68a9d4
44 changed files with 120 additions and 115 deletions

21
flake.lock generated
View file

@ -449,26 +449,6 @@
"type": "github" "type": "github"
} }
}, },
"nix-index-db": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1740281615,
"narHash": "sha256-dZWcbAQ1sF8oVv+zjSKkPVY0ebwENQEkz5vc6muXbKY=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "465792533d03e6bb9dc849d58ab9d5e31fac9023",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-index-database",
"type": "github"
}
},
"nix-minecraft": { "nix-minecraft": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
@ -584,7 +564,6 @@
"homepage": "homepage", "homepage": "homepage",
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-flatpak": "nix-flatpak", "nix-flatpak": "nix-flatpak",
"nix-index-db": "nix-index-db",
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",

View file

@ -33,11 +33,6 @@
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
nix-index-db = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-minecraft = { nix-minecraft = {
url = "github:Infinidoge/nix-minecraft"; url = "github:Infinidoge/nix-minecraft";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -64,7 +59,6 @@
homepage, homepage,
impermanence, impermanence,
nix-flatpak, nix-flatpak,
nix-index-db,
nix-minecraft, nix-minecraft,
nixos-generators, nixos-generators,
stylix, stylix,
@ -86,7 +80,6 @@
agenix.nixosModules.default agenix.nixosModules.default
home-manager.nixosModules.default home-manager.nixosModules.default
impermanence.nixosModules.impermanence impermanence.nixosModules.impermanence
nix-index-db.nixosModules.nix-index
nix-flatpak.nixosModules.nix-flatpak nix-flatpak.nixosModules.nix-flatpak
stylix.nixosModules.stylix stylix.nixosModules.stylix
{ {
@ -112,7 +105,6 @@
agenix.nixosModules.default agenix.nixosModules.default
home-manager.nixosModules.default home-manager.nixosModules.default
impermanence.nixosModules.impermanence impermanence.nixosModules.impermanence
nix-index-db.nixosModules.nix-index
nix-flatpak.nixosModules.nix-flatpak nix-flatpak.nixosModules.nix-flatpak
stylix.nixosModules.stylix stylix.nixosModules.stylix
{ {

View file

@ -1,30 +1,22 @@
{ ... }: { ... }:
{ {
networking.hostName = "alexandria";
imports = [ imports = [
./modules ./modules/alexandria
./alexandria ./modules/boot.nix
./modules/console.nix
./modules/desktop.nix
./modules/locale.nix
./modules/networking.nix
./modules/nix.nix
./modules/programs.nix
./modules/security.nix
./modules/services.nix
./modules/users.nix
./modules/virtualisation.nix
]; ];
nix.nixPath = [ "nixos-config=${./alexandria.nix}" ]; nix.nixPath = [ "nixos-config=${./alexandria.nix}" ];
swapDevices = [
{
device = "/swapfile";
size = 8192;
}
];
networking = {
hostName = "alexandria";
firewall = {
allowedTCPPorts = [
80
443
8010
9666
];
allowedUDPPorts = [ 24454 ];
};
};
} }

View file

@ -1,30 +0,0 @@
{ config, lib, ... }:
{
services = {
paperless = {
enable = true;
dataDir = "/data/paperless/data";
mediaDir = "/data/paperless/media";
passwordFile = config.age.secrets.paperless.path;
port = lib.toInt "${config.ports.paperless}";
consumptionDirIsPublic = true;
settings = {
PAPERLESS_OCR_LANGUAGE = "eng+por+deu";
};
};
nginx.virtualHosts."docs.baduhai.dev" = {
useACMEHost = "baduhai.dev";
forceSSL = true;
kTLS = true;
locations."/".proxyPass = "http://127.0.0.1:${config.ports.paperless}";
};
};
age.secrets.paperless = {
file = ../../../secrets/paperless.age;
owner = "paperless";
group = "hosted";
};
}

View file

@ -4,8 +4,21 @@
networking.hostName = "io"; networking.hostName = "io";
imports = [ imports = [
./modules ./modules/io
./io ./modules/boot.nix
./modules/console.nix
./modules/desktop.nix
./modules/flatpak.nix
./modules/impermanence.nix
./modules/locale.nix
./modules/networking.nix
./modules/nix.nix
./modules/programs.nix
./modules/security.nix
./modules/services.nix
./modules/stylix.nix
./modules/users.nix
./modules/virtualisation.nix
]; ];
nix.nixPath = [ "nixos-config=${./io.nix}" ]; nix.nixPath = [ "nixos-config=${./io.nix}" ];

View file

@ -22,7 +22,6 @@ in
./minecraft.nix ./minecraft.nix
./nextcloud.nix ./nextcloud.nix
./nginx.nix ./nginx.nix
./paperless.nix
./searx.nix ./searx.nix
./services.nix ./services.nix
./users.nix ./users.nix

View file

@ -23,15 +23,23 @@
extraModulePackages = [ ]; extraModulePackages = [ ];
}; };
fileSystems."/" = { fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/31289617-1d84-4432-a833-680b52e88525"; device = "/dev/disk/by-uuid/31289617-1d84-4432-a833-680b52e88525";
fsType = "ext4"; fsType = "ext4";
}; };
"/boot" = {
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/4130-BE54"; device = "/dev/disk/by-uuid/4130-BE54";
fsType = "vfat"; fsType = "vfat";
}; };
};
swapDevices = [
{
device = "/swapfile";
size = 8192;
}
];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;

View file

@ -0,0 +1,15 @@
{ ... }:
{
networking = {
firewall = {
allowedTCPPorts = [
80
443
8010
9666
];
allowedUDPPorts = [ 24454 ];
};
};
}

View file

@ -5,14 +5,15 @@
./boot.nix ./boot.nix
./console.nix ./console.nix
./desktop.nix ./desktop.nix
./impermanence.nix # ./flatpak.nix
# ./impermanence.nix
./locale.nix ./locale.nix
./networking.nix ./networking.nix
./nix.nix ./nix.nix
./programs.nix ./programs.nix
./security.nix ./security.nix
./services.nix ./services.nix
./stylix.nix # ./stylix.nix
./users.nix ./users.nix
./virtualisation.nix ./virtualisation.nix
]; ];

35
hosts/modules/flatpak.nix Normal file
View file

@ -0,0 +1,35 @@
{
hostType,
lib,
...
}:
{
config = lib.mkMerge [
# Common configuration
{
}
# Server specific configuration
(lib.mkIf hostType.isServer {
})
# Workstation specific configuration
(lib.mkIf hostType.isWorkstation {
services.flatpak = {
enable = true;
packages = [
"com.github.k4zmu2a.spacecadetpinball"
"com.github.tchx84.Flatseal"
"com.steamgriddb.SGDBoop"
"app.zen_browser.zen"
"io.github.Foldex.AdwSteamGtk"
"io.itch.itch"
"org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/24.08"
];
uninstallUnmanaged = true;
update.auto.enable = true;
};
})
];
}

View file

@ -1,4 +1,8 @@
{ hostType, lib, ... }: {
hostType,
lib,
...
}:
{ {
config = lib.mkMerge [ config = lib.mkMerge [

View file

@ -2,7 +2,7 @@
{ {
imports = [ imports = [
./boot ./boot.nix
./ephermal.nix ./ephermal.nix
./hardware-configuration.nix ./hardware-configuration.nix
./programs.nix ./programs.nix

View file

@ -129,21 +129,6 @@
] ]
++ kdepkgs; ++ kdepkgs;
services.flatpak = {
enable = true;
packages = [
"com.github.k4zmu2a.spacecadetpinball"
"com.github.tchx84.Flatseal"
"com.steamgriddb.SGDBoop"
"app.zen_browser.zen"
"io.github.Foldex.AdwSteamGtk"
"io.itch.itch"
"org.freedesktop.Platform.VulkanLayer.MangoHud/x86_64/24.08"
];
uninstallUnmanaged = true;
update.auto.enable = true;
};
programs = { programs = {
adb.enable = true; adb.enable = true;
steam.enable = true; steam.enable = true;
@ -152,7 +137,6 @@
kdeconnect.enable = true; kdeconnect.enable = true;
partition-manager.enable = true; partition-manager.enable = true;
gamemode.enable = true; gamemode.enable = true;
nix-index-database.comma.enable = true;
appimage = { appimage = {
enable = true; enable = true;
binfmt = true; binfmt = true;

View file

@ -4,8 +4,21 @@
networking.hostName = "rotterdam"; networking.hostName = "rotterdam";
imports = [ imports = [
./rotterdam ./modules/rotterdam
./modules ./modules/boot.nix
./modules/console.nix
./modules/desktop.nix
./modules/flatpak.nix
./modules/impermanence.nix
./modules/locale.nix
./modules/networking.nix
./modules/nix.nix
./modules/programs.nix
./modules/security.nix
./modules/services.nix
./modules/stylix.nix
./modules/users.nix
./modules/virtualisation.nix
]; ];
nix.nixPath = [ "nixos-config=${./rotterdam.nix}" ]; nix.nixPath = [ "nixos-config=${./rotterdam.nix}" ];

View file

@ -9,6 +9,6 @@
imports = [ imports = [
./modules ./modules
./root ./modules/root
]; ];
} }

View file

@ -9,6 +9,6 @@
imports = [ imports = [
./modules ./modules
./user ./modules/user
]; ];
} }