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"
}
},
"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": {
"inputs": {
"flake-compat": "flake-compat_2",
@ -584,7 +564,6 @@
"homepage": "homepage",
"impermanence": "impermanence",
"nix-flatpak": "nix-flatpak",
"nix-index-db": "nix-index-db",
"nix-minecraft": "nix-minecraft",
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs",

View file

@ -33,11 +33,6 @@
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 = {
url = "github:Infinidoge/nix-minecraft";
inputs.nixpkgs.follows = "nixpkgs";
@ -64,7 +59,6 @@
homepage,
impermanence,
nix-flatpak,
nix-index-db,
nix-minecraft,
nixos-generators,
stylix,
@ -86,7 +80,6 @@
agenix.nixosModules.default
home-manager.nixosModules.default
impermanence.nixosModules.impermanence
nix-index-db.nixosModules.nix-index
nix-flatpak.nixosModules.nix-flatpak
stylix.nixosModules.stylix
{
@ -112,7 +105,6 @@
agenix.nixosModules.default
home-manager.nixosModules.default
impermanence.nixosModules.impermanence
nix-index-db.nixosModules.nix-index
nix-flatpak.nixosModules.nix-flatpak
stylix.nixosModules.stylix
{

View file

@ -1,30 +1,22 @@
{ ... }:
{
networking.hostName = "alexandria";
imports = [
./modules
./alexandria
./modules/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}" ];
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";
imports = [
./modules
./io
./modules/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}" ];

View file

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

View file

@ -23,15 +23,23 @@
extraModulePackages = [ ];
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/31289617-1d84-4432-a833-680b52e88525";
fsType = "ext4";
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/31289617-1d84-4432-a833-680b52e88525";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/4130-BE54";
fsType = "vfat";
};
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/4130-BE54";
fsType = "vfat";
};
swapDevices = [
{
device = "/swapfile";
size = 8192;
}
];
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
./console.nix
./desktop.nix
./impermanence.nix
# ./flatpak.nix
# ./impermanence.nix
./locale.nix
./networking.nix
./nix.nix
./programs.nix
./security.nix
./services.nix
./stylix.nix
# ./stylix.nix
./users.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 [

View file

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

View file

@ -129,21 +129,6 @@
]
++ 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 = {
adb.enable = true;
steam.enable = true;
@ -152,7 +137,6 @@
kdeconnect.enable = true;
partition-manager.enable = true;
gamemode.enable = true;
nix-index-database.comma.enable = true;
appimage = {
enable = true;
binfmt = true;

View file

@ -4,8 +4,21 @@
networking.hostName = "rotterdam";
imports = [
./rotterdam
./modules
./modules/rotterdam
./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}" ];

View file

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

View file

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