Compare commits
26 Commits
little-ser
...
master
Author | SHA1 | Date | |
---|---|---|---|
ef484c8ff0 | |||
ea2820a1bb | |||
1c054207b2 | |||
b5b66f1c1b | |||
a1eb9b74c2 | |||
f10c3e7a8c | |||
1f5eda31b2 | |||
1484f3a04e | |||
539f0db8d1 | |||
65bf72cd5b | |||
50d1e00a02 | |||
30b7d23b3a | |||
c8990196b7 | |||
0c8c5c5f2a | |||
93c8464641 | |||
b9dd11dd7b | |||
51d8ee2887 | |||
86970a7f6c | |||
972cd76421 | |||
fe049f0594 | |||
39afe2d114 | |||
b6653cee0b | |||
1e3ffdf0a3 | |||
ea8607eb41 | |||
adabefd821 | |||
d8a9e92dff |
33
flake.lock
generated
33
flake.lock
generated
@ -7,11 +7,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730448474,
|
"lastModified": 1733570843,
|
||||||
"narHash": "sha256-qE/cYKBhzxHMtKtLK3hlSR3uzO1pWPGLrBuQK7r0CHc=",
|
"narHash": "sha256-sQJAxY1TYWD1UyibN/FnN97paTFuwBw3Vp3DNCyKsMk=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "683d0c4cd1102dcccfa3f835565378c7f3cbe05e",
|
"rev": "a35b08d09efda83625bef267eb24347b446c80b8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -28,15 +28,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730490306,
|
"lastModified": 1734366194,
|
||||||
"narHash": "sha256-AvCVDswOUM9D368HxYD25RsSKp+5o0L0/JHADjLoD38=",
|
"narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "1743615b61c7285976f85b303a36cdf88a556503",
|
"rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
|
"ref": "release-24.11",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -62,11 +63,11 @@
|
|||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728031945,
|
"lastModified": 1734338723,
|
||||||
"narHash": "sha256-NRkLjdMtVfC6dD1gEbYZWFEtbmC2xfD6ft1IP7l76Vw=",
|
"narHash": "sha256-BpJs2QnVwdE4Btsx2BcBmdsq86H7QJYv2GmoOkr1ii4=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "nix-ld",
|
"repo": "nix-ld",
|
||||||
"rev": "4524c512e8729ccb5a1b9239d01e1474cbf074a2",
|
"rev": "911665df070e3d6c970e5a248fc4a38550bd5689",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -77,11 +78,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1727634051,
|
"lastModified": 1733015953,
|
||||||
"narHash": "sha256-S5kVU7U82LfpEukbn/ihcyNt2+EvG7Z5unsKW9H/yFA=",
|
"narHash": "sha256-t4BBVpwG9B4hLgc6GUBuj3cjU7lP/PJfpTHuSqE+crk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "06cf0e1da4208d3766d898b7fdab6513366d45b9",
|
"rev": "ac35b104800bff9028425fec3b6e8a41de2bbfff",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -93,16 +94,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726243404,
|
"lastModified": 1734737257,
|
||||||
"narHash": "sha256-sjiGsMh+1cWXb53Tecsm4skyFNag33GPbVgCdfj3n9I=",
|
"narHash": "sha256-GIMyMt1pkkoXdCq9un859bX6YQZ/iYtukb9R5luazLM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "345c263f2f53a3710abe117f28a5cb86d0ba4059",
|
"rev": "1c6e20d41d6a9c1d737945962160e8571df55daa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-24.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
46
flake.nix
46
flake.nix
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
description = "Wyatt's nix configuration suite";
|
description = "Wyatt's nix configuration suite";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||||
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
|
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1";
|
||||||
nix-ld.url = "github:Mic92/nix-ld";
|
nix-ld.url = "github:Mic92/nix-ld";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager/release-24.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
darwin = {
|
darwin = {
|
||||||
@ -37,10 +37,8 @@
|
|||||||
hostname = "sephiroth";
|
hostname = "sephiroth";
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./modules/common/core.nix
|
./modules/common
|
||||||
./modules/common/users.nix
|
./modules/machine/sephiroth
|
||||||
./modules/machine/sephiroth/configuration.nix
|
|
||||||
./modules/machine/sephiroth/apps.nix
|
|
||||||
|
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
{
|
{
|
||||||
@ -62,10 +60,8 @@
|
|||||||
modules = [
|
modules = [
|
||||||
nix-flatpak.nixosModules.nix-flatpak
|
nix-flatpak.nixosModules.nix-flatpak
|
||||||
nix-ld.nixosModules.nix-ld
|
nix-ld.nixosModules.nix-ld
|
||||||
./modules/common/core.nix
|
./modules/common
|
||||||
./modules/common/users.nix
|
./modules/machine/cloud
|
||||||
./modules/machine/cloud/hardware-configuration.nix
|
|
||||||
./modules/machine/cloud/configuration.nix
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
@ -86,21 +82,21 @@
|
|||||||
inherit userName userEmail;
|
inherit userName userEmail;
|
||||||
hostname = "valefor";
|
hostname = "valefor";
|
||||||
};
|
};
|
||||||
# modules = [
|
modules = [
|
||||||
# nix-ld.nixosModules.nix-ld
|
nix-ld.nixosModules.nix-ld
|
||||||
# ./modules/nix-core.nix
|
./modules/common
|
||||||
# ./modules/host-users.nix
|
./modules/machine/valefor
|
||||||
#
|
|
||||||
# home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
# {
|
{
|
||||||
# home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
# home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
# home-manager.extraSpecialArgs = extraSpecialArgs;
|
home-manager.extraSpecialArgs = extraSpecialArgs;
|
||||||
# home-manager.users.${userName}.imports = [
|
home-manager.users.${userName}.imports = [
|
||||||
# ./home
|
./home
|
||||||
# ];
|
];
|
||||||
# }
|
}
|
||||||
# ];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Storage, status, game, and media server
|
# Storage, status, game, and media server
|
||||||
|
@ -50,7 +50,7 @@ in {
|
|||||||
size = 22;
|
size = 22;
|
||||||
};
|
};
|
||||||
|
|
||||||
stateVersion = "24.05";
|
stateVersion = "24.11";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
# Let Home Manager install and manage itself.
|
||||||
|
@ -3,10 +3,6 @@
|
|||||||
userEmail,
|
userEmail,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
# `programs.git` will generate the config file: ~/.config/git/config
|
|
||||||
# to make git use this config file, `~/.gitconfig` should not exist!
|
|
||||||
#
|
|
||||||
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
|
||||||
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
||||||
rm -f ~/.gitconfig
|
rm -f ~/.gitconfig
|
||||||
'';
|
'';
|
||||||
@ -30,6 +26,8 @@
|
|||||||
|
|
||||||
aliases = {
|
aliases = {
|
||||||
# common aliases
|
# common aliases
|
||||||
|
a = "add";
|
||||||
|
ap = "add -p";
|
||||||
br = "branch";
|
br = "branch";
|
||||||
co = "checkout";
|
co = "checkout";
|
||||||
st = "status -sb";
|
st = "status -sb";
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
nnn # terminal file manager
|
nnn # terminal file manager
|
||||||
|
|
||||||
|
0
home/packages/server.nix
Normal file
0
home/packages/server.nix
Normal file
0
home/packages/workstation.nix
Normal file
0
home/packages/workstation.nix
Normal file
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
# top alias
|
# top alias
|
||||||
top = "btm";
|
top = "btm";
|
||||||
htop = "btm";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
functions = {
|
functions = {
|
||||||
@ -70,7 +69,6 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
|
27
modules/apps/flatpak.nix
Normal file
27
modules/apps/flatpak.nix
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
flatpakPackages ? [],
|
||||||
|
flatpakRemotes ? [],
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.flatpak = {
|
||||||
|
enable = true;
|
||||||
|
remotes =
|
||||||
|
if flatpakRemotes == []
|
||||||
|
then [
|
||||||
|
{
|
||||||
|
name = "flathub";
|
||||||
|
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
|
||||||
|
}
|
||||||
|
]
|
||||||
|
else flatpakRemotes;
|
||||||
|
packages = flatpakPackages;
|
||||||
|
update = {
|
||||||
|
auto = {
|
||||||
|
enable = true;
|
||||||
|
onCalendar = "weekly";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
159
modules/apps/gaming.nix
Normal file
159
modules/apps/gaming.nix
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.gaming;
|
||||||
|
in {
|
||||||
|
options.gaming = {
|
||||||
|
steam = {
|
||||||
|
enable = lib.mkEnableOption "Steam gaming platform";
|
||||||
|
|
||||||
|
firewall = {
|
||||||
|
remotePlay = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Open firewall ports for Steam Remote Play";
|
||||||
|
};
|
||||||
|
|
||||||
|
localNetworkGameTransfers = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Open firewall ports for local network game transfers";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
gamemode = {
|
||||||
|
enable = lib.mkEnableOption "Gamemode performance optimization";
|
||||||
|
config = lib.mkOption {
|
||||||
|
type = lib.types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = "Custom Gamemode configuration options";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
gamescope = {
|
||||||
|
enable = lib.mkEnableOption "Gamescope gaming compositor";
|
||||||
|
settings = {
|
||||||
|
resolution = lib.mkOption {
|
||||||
|
type = lib.types.nullOr (lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
width = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
description = "Gamescope rendering width";
|
||||||
|
};
|
||||||
|
height = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
description = "Gamescope rendering height";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = null;
|
||||||
|
description = "Gamescope rendering resolution";
|
||||||
|
};
|
||||||
|
|
||||||
|
refreshRate = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.int;
|
||||||
|
default = null;
|
||||||
|
description = "Gamescope rendering refresh rate";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
lutris = {
|
||||||
|
enable = lib.mkEnableOption "Lutris game manager and launcher";
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.lutris;
|
||||||
|
description = "Lutris package to use (allows for custom or alternative packages)";
|
||||||
|
};
|
||||||
|
|
||||||
|
wine = {
|
||||||
|
enable = lib.mkEnableOption "Enable Wine support for Lutris";
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.wine-staging;
|
||||||
|
description = "Wine package to use with Lutris";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Compatibility layers for Lutris
|
||||||
|
compatibility = {
|
||||||
|
protonSupport = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable Proton-like compatibility layers for Lutris";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraTools = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.package;
|
||||||
|
default = [];
|
||||||
|
description = "Additional compatibility tools for Lutris";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Additional system packages for Lutris
|
||||||
|
extraPackages = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.package;
|
||||||
|
default = [];
|
||||||
|
description = "Additional packages to install alongside Lutris";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
minecraft = {
|
||||||
|
enable = lib.mkEnableOption "Minecraft in the form of PrismLauncher, a tool for launching Minecraft";
|
||||||
|
};
|
||||||
|
ffxiv = {
|
||||||
|
enable = lib.mkEnableOption "Final Fantasy XIV and it's accompanied (unofficial) launcher";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
programs.steam = lib.mkIf cfg.steam.enable {
|
||||||
|
enable = true;
|
||||||
|
remotePlay.openFirewall = cfg.steam.firewall.remotePlay;
|
||||||
|
localNetworkGameTransfers.openFirewall = cfg.steam.firewall.localNetworkGameTransfers;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.gamemode = lib.mkIf cfg.gamemode.enable {
|
||||||
|
enable = true;
|
||||||
|
settings = cfg.gamemode.config;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.gamescope = lib.mkIf cfg.gamescope.enable {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Apply custom resolution if specified
|
||||||
|
args =
|
||||||
|
lib.optional (cfg.gamescope.settings.resolution != null) [
|
||||||
|
"-w"
|
||||||
|
(toString cfg.gamescope.settings.resolution.width)
|
||||||
|
"-h"
|
||||||
|
(toString cfg.gamescope.settings.resolution.height)
|
||||||
|
]
|
||||||
|
++ lib.optional (cfg.gamescope.settings.refreshRate != null) [
|
||||||
|
"-r"
|
||||||
|
(toString cfg.gamescope.settings.refreshRate)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages =
|
||||||
|
(lib.optionals cfg.lutris.enable (
|
||||||
|
[cfg.lutris.package] ++
|
||||||
|
(lib.optionals cfg.lutris.wine.enable [
|
||||||
|
cfg.lutris.wine.package
|
||||||
|
pkgs.winetricks
|
||||||
|
]) ++
|
||||||
|
(lib.optionals cfg.lutris.compatibility.protonSupport [
|
||||||
|
pkgs.protonup-ng
|
||||||
|
pkgs.protonup-qt
|
||||||
|
]) ++
|
||||||
|
cfg.lutris.compatibility.extraTools ++
|
||||||
|
cfg.lutris.extraPackages
|
||||||
|
)) ++
|
||||||
|
(lib.optionals cfg.minecraft.enable [pkgs.prismlauncher]) ++
|
||||||
|
(lib.optionals cfg.ffxiv.enable [pkgs.xivlauncher]);
|
||||||
|
};
|
||||||
|
}
|
0
modules/apps/xdg.nix
Normal file
0
modules/apps/xdg.nix
Normal file
11
modules/common/default.nix
Normal file
11
modules/common/default.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
./core.nix
|
||||||
|
./fonts.nix
|
||||||
|
./users.nix
|
||||||
|
];
|
||||||
|
}
|
14
modules/common/fonts.nix
Normal file
14
modules/common/fonts.nix
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
fonts.packages = with pkgs; [
|
||||||
|
nerdfonts
|
||||||
|
noto-fonts
|
||||||
|
noto-fonts-emoji
|
||||||
|
liberation_ttf
|
||||||
|
noto-fonts-cjk-sans
|
||||||
|
monaspace
|
||||||
|
];
|
||||||
|
}
|
@ -5,16 +5,8 @@
|
|||||||
hostname,
|
hostname,
|
||||||
...
|
...
|
||||||
} @ args: {
|
} @ args: {
|
||||||
# Set up networking configuration
|
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
# networking.computerName = hostname;
|
|
||||||
# networking.firewall.enable = true; # VERY important, do not touch
|
|
||||||
# networking.firewall.allowedTCPPorts = [];
|
|
||||||
# networking.firewall.allowedUDPPorts = [];
|
|
||||||
# networking.networkmanager.enable = pkgs.stdenv.isLinux; # Linux tool for managing network connections
|
|
||||||
# system.defaults.smb.NetBIOSName = hostname;
|
|
||||||
|
|
||||||
# Set up user accounts
|
|
||||||
# Don't forget to set a password with ‘passwd’!
|
# Don't forget to set a password with ‘passwd’!
|
||||||
users.users."${userName}" = lib.mkMerge [
|
users.users."${userName}" = lib.mkMerge [
|
||||||
{
|
{
|
||||||
|
107
modules/graphics/default.nix
Normal file
107
modules/graphics/default.nix
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.graphics;
|
||||||
|
in {
|
||||||
|
options.graphics = {
|
||||||
|
gpuVendor = mkOption {
|
||||||
|
type = types.enum ["nvidia" "amd" "intel" "none"];
|
||||||
|
default = "none";
|
||||||
|
description = "GPU vendor to configure graphics drivers for";
|
||||||
|
};
|
||||||
|
|
||||||
|
enable = mkEnableOption "graphics configuration";
|
||||||
|
|
||||||
|
wayland = {
|
||||||
|
enable = mkEnableOption "Wayland support";
|
||||||
|
|
||||||
|
variableRefreshRate = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable variable refresh rate (FreeSync/G-Sync) support";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vulkan = {
|
||||||
|
enable = mkEnableOption "Vulkan support";
|
||||||
|
|
||||||
|
debug = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Enable Vulkan validation layers";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
glxinfo
|
||||||
|
vulkan-tools
|
||||||
|
mesa-demos
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf (cfg.gpuVendor == "nvidia") {
|
||||||
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
|
hardware.nvidia = {
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||||
|
open = true;
|
||||||
|
modesetting.enable = true;
|
||||||
|
powerManagement.enable = true;
|
||||||
|
};
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
nvidia-vaapi-driver
|
||||||
|
nvtopPackages.full
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf (cfg.gpuVendor == "amd") {
|
||||||
|
services.xserver.videoDrivers = ["amdgpu"];
|
||||||
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
|
rocm-opencl-icd
|
||||||
|
rocm-opencl-runtime
|
||||||
|
amdvlk
|
||||||
|
];
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
radeontop
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf (cfg.gpuVendor == "intel") {
|
||||||
|
services.xserver.videoDrivers = ["modesetting"];
|
||||||
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
|
intel-media-driver
|
||||||
|
intel-compute-runtime
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.wayland.enable {
|
||||||
|
programs.xwayland.enable = true;
|
||||||
|
environment.sessionVariables = {
|
||||||
|
MOZ_ENABLE_WAYLAND = "1";
|
||||||
|
QT_QPA_PLATFORM = "wayland";
|
||||||
|
SDL_VIDEODRIVER = "wayland";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.vulkan.enable {
|
||||||
|
environment.systemPackages = with pkgs;
|
||||||
|
[
|
||||||
|
vulkan-loader
|
||||||
|
vulkan-validation-layers
|
||||||
|
]
|
||||||
|
++ (
|
||||||
|
if cfg.vulkan.debug
|
||||||
|
then [
|
||||||
|
vulkan-tools
|
||||||
|
]
|
||||||
|
else []
|
||||||
|
);
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
@ -7,3 +7,7 @@ Licensed by the Mozilla Public License v2
|
|||||||
## Synopsis
|
## Synopsis
|
||||||
|
|
||||||
This directory is where the machine-specific configuration files for hostname `cloud` live, my primary desktop. These files get called by the root `flake.nix` file.
|
This directory is where the machine-specific configuration files for hostname `cloud` live, my primary desktop. These files get called by the root `flake.nix` file.
|
||||||
|
|
||||||
|
### `TODO` list
|
||||||
|
|
||||||
|
- Migrate to (disko)[https://github.com/nix-community/disko]
|
||||||
|
@ -1,70 +1,55 @@
|
|||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
userName,
|
userName,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
|
flatpakPackages = [
|
||||||
|
"com.github.tchx84.Flatseal"
|
||||||
|
"com.slack.Slack"
|
||||||
|
"info.beyondallreason.bar"
|
||||||
|
"io.dbeaver.DBeaverCommunity"
|
||||||
|
"io.openrct2.OpenRCT2"
|
||||||
|
"md.obsidian.Obsidian"
|
||||||
|
"org.prismlauncher.PrismLauncher"
|
||||||
|
"sh.cider.Cider"
|
||||||
|
];
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(import ../../apps/flatpak.nix {
|
||||||
|
inherit lib pkgs flatpakPackages;
|
||||||
|
})
|
||||||
|
../../apps/gaming.nix
|
||||||
|
../../graphics
|
||||||
|
../../pwrMgmt
|
||||||
|
../../networking/core.nix
|
||||||
|
../../sound/pipewire.nix
|
||||||
|
../../sound/shairport.nix
|
||||||
|
../../virtualization/podman.nix
|
||||||
|
../../virtualization/hardware.nix
|
||||||
|
];
|
||||||
|
|
||||||
# Enable flakes for NixOS
|
# Enable flakes for NixOS
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||||
|
|
||||||
# Utilize systemd-boot
|
# Custom kernel/boot stuff
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
# Install and enable common graphics drivers
|
|
||||||
hardware.opengl = {
|
|
||||||
# driSupport = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
mesa
|
|
||||||
libvdpau-va-gl
|
|
||||||
libva
|
|
||||||
libva-utils
|
|
||||||
intel-vaapi-driver # for Intel
|
|
||||||
intel-media-driver # for Intel
|
|
||||||
rocm-opencl-icd # for AMD
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# For systems with AMD graphics, this enables Vulkan on 32-bit applications
|
|
||||||
# For 64-bit application, however, Vulkan is enabled by default
|
|
||||||
# hardware.graphics.driSupport32Bit = true;
|
|
||||||
|
|
||||||
# For systems with AMD graphics, enable AMDVLK
|
|
||||||
#hardware.graphics = {
|
|
||||||
# extraPackages = with pkgs; [
|
|
||||||
# amdvlk
|
|
||||||
# ];
|
|
||||||
# extraPackages32 = with pkgs; [
|
|
||||||
# driversi686Linux
|
|
||||||
# ];
|
|
||||||
#};
|
|
||||||
|
|
||||||
# Enable Bluetooth if present
|
# Enable Bluetooth if present
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
# Set your timezone
|
# Set your timezone
|
||||||
time.timeZone = "America/Detroit";
|
time.timeZone = "America/Detroit";
|
||||||
|
|
||||||
# Enable Pipewire (sound)
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable touchpad
|
|
||||||
services.libinput.enable = true;
|
|
||||||
|
|
||||||
# Install packages to be installed system-wide
|
# Install packages to be installed system-wide
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
vim
|
vim
|
||||||
neovim
|
neovim
|
||||||
git
|
git
|
||||||
wireguard-tools
|
wireguard-tools
|
||||||
podman
|
|
||||||
buildah
|
|
||||||
podman-tui
|
|
||||||
podman-compose
|
|
||||||
podman-desktop
|
|
||||||
toolbox
|
|
||||||
grim
|
grim
|
||||||
slurp
|
slurp
|
||||||
playerctl
|
playerctl
|
||||||
@ -73,20 +58,9 @@
|
|||||||
firefox
|
firefox
|
||||||
wttrbar
|
wttrbar
|
||||||
cliphist
|
cliphist
|
||||||
xivlauncher
|
|
||||||
patchelf
|
patchelf
|
||||||
];
|
];
|
||||||
|
|
||||||
# Install system-wide fonts
|
|
||||||
fonts.packages = with pkgs; [
|
|
||||||
noto-fonts
|
|
||||||
noto-fonts-cjk
|
|
||||||
noto-fonts-emoji
|
|
||||||
liberation_ttf
|
|
||||||
monaspace
|
|
||||||
nerdfonts
|
|
||||||
];
|
|
||||||
|
|
||||||
# Set the EDITOR global environment variable to neovim
|
# Set the EDITOR global environment variable to neovim
|
||||||
environment.variables.EDITOR = "nvim";
|
environment.variables.EDITOR = "nvim";
|
||||||
|
|
||||||
@ -108,25 +82,69 @@
|
|||||||
# Enable Polkit
|
# Enable Polkit
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
# Enable power management
|
# Graphics module (../../graphics/default.nix)
|
||||||
powerManagement = {
|
graphics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
powertop.enable = false; # TODO: to be enabled on laptops
|
gpuVendor = "amd"; # or "amd" or "intel"
|
||||||
cpuFreqGovernor = "performace";
|
wayland.enable = true;
|
||||||
|
vulkan.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable Steam and open various firewall ports when applicable
|
# Gaming module (see ../../apps/gaming.nix)
|
||||||
programs.steam = {
|
gaming = {
|
||||||
enable = true;
|
steam = {
|
||||||
remotePlay.openFirewall = true;
|
enable = true;
|
||||||
localNetworkGameTransfers.openFirewall = true;
|
firewall = {
|
||||||
|
remotePlay = true;
|
||||||
|
localNetworkGameTransfers = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
gamemode.enable = true;
|
||||||
|
gamescope.enable = true;
|
||||||
|
lutris = {
|
||||||
|
enable = true;
|
||||||
|
wine = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.wine-staging;
|
||||||
|
};
|
||||||
|
compatibility = {
|
||||||
|
protonSupport = true;
|
||||||
|
};
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
gamemode
|
||||||
|
mangohud
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
ffxiv.enable = true;
|
||||||
|
minecraft.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable gamemode (gamemode, gamemoded, gamemoderun) when needed
|
# Power management (see ../../pwrMgmt/default.nix)
|
||||||
programs.gamemode.enable = true;
|
pwrMgmt = {
|
||||||
|
enable = true;
|
||||||
|
cpuFreqGovernor = "performance";
|
||||||
|
powertop.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Enable gamescope (compositor) when needed
|
# Podman module (see ../../virtualization/podman.nix)
|
||||||
programs.gamescope.enable = true;
|
podman = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
docker-credential-helpers
|
||||||
|
toolbox
|
||||||
|
cosign
|
||||||
|
crane
|
||||||
|
podman-tui
|
||||||
|
podman-desktop
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Core networking module (see ../../networking/core.nix)
|
||||||
|
network = {
|
||||||
|
firewall.enable = true;
|
||||||
|
networkmanager.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Enable dconf
|
# Enable dconf
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
@ -134,6 +152,9 @@
|
|||||||
# Add username to groups "wheel" and "video" - more may be added here later
|
# Add username to groups "wheel" and "video" - more may be added here later
|
||||||
users.users.${userName}.extraGroups = ["wheel" "video" "gamemode" "podman" "network"];
|
users.users.${userName}.extraGroups = ["wheel" "video" "gamemode" "podman" "network"];
|
||||||
|
|
||||||
|
# Flatpak packages (see ../../apps/flatpak.nix)
|
||||||
|
services.flatpak.packages = flatpakPackages;
|
||||||
|
|
||||||
# XDG stuff
|
# XDG stuff
|
||||||
xdg = {
|
xdg = {
|
||||||
portal = {
|
portal = {
|
||||||
@ -154,57 +175,5 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Firewall stuff not allowed in common user and network creation
|
system.stateVersion = "24.11";
|
||||||
networking.firewall.enable = true; # VERY important, do not touch
|
|
||||||
networking.firewall.allowedTCPPorts = [];
|
|
||||||
networking.firewall.allowedUDPPorts = [];
|
|
||||||
networking.networkmanager.enable = true; # Linux tool for managing network connections
|
|
||||||
|
|
||||||
# Enable Flatpak (app containerization)
|
|
||||||
# services.flatpak.enable = true;
|
|
||||||
services.flatpak = {
|
|
||||||
enable = true;
|
|
||||||
remotes = [
|
|
||||||
{
|
|
||||||
name = "flathub";
|
|
||||||
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
packages = [
|
|
||||||
"com.github.tchx84.Flatseal"
|
|
||||||
"com.slack.Slack"
|
|
||||||
"info.beyondallreason.bar"
|
|
||||||
"io.dbeaver.DBeaverCommunity"
|
|
||||||
"io.openrct2.OpenRCT2"
|
|
||||||
"md.obsidian.Obsidian"
|
|
||||||
"org.prismlauncher.PrismLauncher"
|
|
||||||
"sh.cider.Cider"
|
|
||||||
];
|
|
||||||
update = {
|
|
||||||
auto = {
|
|
||||||
enable = true;
|
|
||||||
onCalendar = "weekly";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable Podman (OCI containers)
|
|
||||||
virtualisation.podman = {
|
|
||||||
enable = true;
|
|
||||||
dockerSocket.enable = true;
|
|
||||||
defaultNetwork.settings.dns_enabled = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.shairport-sync = {
|
|
||||||
enable = pkgs.stdenv.isLinux;
|
|
||||||
openFirewall = pkgs.stdenv.isLinux;
|
|
||||||
arguments = "-v -o pw";
|
|
||||||
};
|
|
||||||
|
|
||||||
# users.users."${userName}" = {
|
|
||||||
# group = "${userName}";
|
|
||||||
# isNormalUser = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
|
||||||
}
|
}
|
||||||
|
6
modules/machine/cloud/default.nix
Normal file
6
modules/machine/cloud/default.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./configuration.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
}
|
@ -8,17 +8,11 @@
|
|||||||
|
|
||||||
homebrew = {
|
homebrew = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
onActivation = {
|
onActivation = {
|
||||||
autoUpdate = false;
|
autoUpdate = false;
|
||||||
# 'zap': uninstalls all formulae(and related files) not listed here.
|
|
||||||
cleanup = "zap";
|
cleanup = "zap";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Applications to install from Mac App Store using mas.
|
|
||||||
# You need to install all these Apps manually first so that your apple account have records for them.
|
|
||||||
# otherwise Apple Store will refuse to install them.
|
|
||||||
# For details, see https://github.com/mas-cli/mas
|
|
||||||
masApps = {
|
masApps = {
|
||||||
Xcode = 497799835;
|
Xcode = 497799835;
|
||||||
"Reeder 5." = 1529448980;
|
"Reeder 5." = 1529448980;
|
||||||
@ -34,6 +28,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
casks = [
|
casks = [
|
||||||
|
"ghostty"
|
||||||
"raycast"
|
"raycast"
|
||||||
"jordanbaird-ice"
|
"jordanbaird-ice"
|
||||||
];
|
];
|
||||||
|
@ -3,30 +3,22 @@
|
|||||||
hostname,
|
hostname,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
imports = [
|
||||||
|
../../virtualization/podman.nix
|
||||||
|
];
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
|
|
||||||
activationScripts.postUserActivation.text = ''
|
activationScripts.postUserActivation.text = ''
|
||||||
# activateSettings -u will reload the settings from the database and apply them to the current session,
|
|
||||||
# so we do not need to logout and login again to make the changes take effect.
|
|
||||||
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||||
'';
|
'';
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
menuExtraClock.Show24Hour = true; # show 24 hour clock
|
menuExtraClock.Show24Hour = true;
|
||||||
|
|
||||||
# customize dock
|
|
||||||
dock = {
|
dock = {
|
||||||
autohide = true;
|
autohide = true;
|
||||||
# show-recents = false; # disable recent apps
|
|
||||||
|
|
||||||
# # customize Hot Corners
|
|
||||||
# wvous-tl-corner = 2; # top-left - Mission Control
|
|
||||||
# wvous-tr-corner = 13; # top-right - Lock Screen
|
|
||||||
# wvous-bl-corner = 3; # bottom-left - Application Windows
|
|
||||||
# wvous-br-corner = 4; # bottom-right - Desktop
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# # customize finder
|
|
||||||
finder = {
|
finder = {
|
||||||
_FXShowPosixPathInTitle = true; # show full path in finder title
|
_FXShowPosixPathInTitle = true; # show full path in finder title
|
||||||
AppleShowAllExtensions = true; # show all file extensions
|
AppleShowAllExtensions = true; # show all file extensions
|
||||||
@ -36,7 +28,6 @@
|
|||||||
ShowStatusBar = true; # show status bar
|
ShowStatusBar = true; # show status bar
|
||||||
};
|
};
|
||||||
|
|
||||||
# # customize trackpad
|
|
||||||
# trackpad = {
|
# trackpad = {
|
||||||
# Clicking = true; # enable tap to click
|
# Clicking = true; # enable tap to click
|
||||||
# TrackpadRightClick = true; # enable two finger right click
|
# TrackpadRightClick = true; # enable two finger right click
|
||||||
@ -176,6 +167,15 @@
|
|||||||
|
|
||||||
system.stateVersion = 5;
|
system.stateVersion = 5;
|
||||||
|
|
||||||
|
podman = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
docker-credential-helpers
|
||||||
|
cosign
|
||||||
|
crane
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "America/Detroit";
|
time.timeZone = "America/Detroit";
|
||||||
}
|
}
|
||||||
|
6
modules/machine/sephiroth/default.nix
Normal file
6
modules/machine/sephiroth/default.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./apps.nix
|
||||||
|
./configuration.nix
|
||||||
|
];
|
||||||
|
}
|
102
modules/machine/valefor/configuration.nix
Normal file
102
modules/machine/valefor/configuration.nix
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
userName,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
../../graphics
|
||||||
|
../../pwrMgmt
|
||||||
|
../../networking/core.nix
|
||||||
|
../../networking/dns.nix
|
||||||
|
../../virtualization/podman.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Enable flakes for NixOS
|
||||||
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||||
|
|
||||||
|
# Custom kernel/boot stuff
|
||||||
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
# Enable Bluetooth if present
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
|
# Set your timezone
|
||||||
|
time.timeZone = "America/Detroit";
|
||||||
|
|
||||||
|
# Install packages to be installed system-wide
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
vim
|
||||||
|
neovim
|
||||||
|
git
|
||||||
|
patchelf
|
||||||
|
];
|
||||||
|
|
||||||
|
# Set the EDITOR global environment variable to neovim
|
||||||
|
environment.variables.EDITOR = "nvim";
|
||||||
|
|
||||||
|
# Enable OpenSSH
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
# Enable keyring
|
||||||
|
services.gnome.gnome-keyring.enable = true;
|
||||||
|
|
||||||
|
# Enable GnuPG
|
||||||
|
programs.gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Enable SUID wrappers (some programs need them)
|
||||||
|
programs.mtr.enable = true;
|
||||||
|
|
||||||
|
# Enable Polkit
|
||||||
|
security.polkit.enable = true;
|
||||||
|
|
||||||
|
# Graphics module (../../graphics/default.nix)
|
||||||
|
graphics = {
|
||||||
|
enable = true;
|
||||||
|
gpuVendor = "intel";
|
||||||
|
wayland.enable = true;
|
||||||
|
vulkan.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Power management (see ../../pwrMgmt/default.nix)
|
||||||
|
pwrMgmt = {
|
||||||
|
enable = true;
|
||||||
|
cpuFreqGovernor = "performance";
|
||||||
|
powertop.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Podman module (see ../../virtualization/podman.nix)
|
||||||
|
podman = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
docker-credential-helpers
|
||||||
|
toolbox
|
||||||
|
cosign
|
||||||
|
crane
|
||||||
|
podman-tui
|
||||||
|
podman-desktop
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Core networking module (see ../../networking/core.nix)
|
||||||
|
network = {
|
||||||
|
firewall.enable = true;
|
||||||
|
networkManager.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# DNS module (see ../../networking/dns.nix)
|
||||||
|
dns = {
|
||||||
|
technitium.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Add username to groups "wheel" and "video" - more may be added here later
|
||||||
|
users.users.${userName}.extraGroups = ["wheel" "podman" "network"];
|
||||||
|
|
||||||
|
system.stateVersion = "24.11";
|
||||||
|
}
|
6
modules/machine/valefor/default.nix
Normal file
6
modules/machine/valefor/default.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./configuration.nix
|
||||||
|
./hardware-configuration.nix
|
||||||
|
];
|
||||||
|
}
|
39
modules/machine/valefor/hardware-configuration.nix
Normal file
39
modules/machine/valefor/hardware-configuration.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/ff89bde1-4b33-4277-b649-b92700b2406c";
|
||||||
|
fsType = "xfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/3A4B-6866";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
90
modules/networking/README.md
Normal file
90
modules/networking/README.md
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# Network and networking modules
|
||||||
|
|
||||||
|
This directory houses all network, firewall, DHCP, DNS, and all other related networking enablement.
|
||||||
|
|
||||||
|
## `core.nix`
|
||||||
|
|
||||||
|
This is where the firewall and NetworkManager live. For the firewall, you have pre-defined options that will open ports for you by enabling some network service.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
tcpPorts.web.enable = true;
|
||||||
|
udpPorts.dns.enable = true;
|
||||||
|
```
|
||||||
|
|
||||||
|
Here's a more featureful example of how you would enable a firewall and set up NetworkManager:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
customNetworking = {
|
||||||
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Open web service ports
|
||||||
|
tcpPorts.web.enable = true;
|
||||||
|
|
||||||
|
# Custom TCP ports
|
||||||
|
tcpPorts.allowedPorts = [ 8080 22 ];
|
||||||
|
|
||||||
|
# Custom UDP ports
|
||||||
|
udpPorts.allowedPorts = [ 5000 ];
|
||||||
|
};
|
||||||
|
|
||||||
|
networkManager = {
|
||||||
|
enable = true;
|
||||||
|
extraPlugins = with pkgs; [
|
||||||
|
# Additional NetworkManager plugins
|
||||||
|
networkmanager-openvpn
|
||||||
|
networkmanager-openconnect
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
As shown above, you'll have to open ports for services you would want to access remotely.
|
||||||
|
|
||||||
|
## DNS
|
||||||
|
|
||||||
|
There are two options here: BIND9 (or simply Bind) or Technitium DNS server. Enabling both DNS servers will throw an error and your configuration will not build.
|
||||||
|
|
||||||
|
You'll have to import `./dns.nix` for the services to be enabled.
|
||||||
|
|
||||||
|
Here's an example of what configuration might look like:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
dns.bind = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
interfaces = [ "127.0.0.1" "192.168.100.100" ];
|
||||||
|
zones = [
|
||||||
|
{
|
||||||
|
name = "example.com";
|
||||||
|
type = "master";
|
||||||
|
file = "/etc/named/zones/example.com.zone";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
// Additional BIND configuration
|
||||||
|
options {
|
||||||
|
directory "/var/named";
|
||||||
|
recursion yes;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
_or_
|
||||||
|
|
||||||
|
```nix
|
||||||
|
dns.technitium = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
address = "192.168.100.0";
|
||||||
|
port = 5380;
|
||||||
|
extraOptions = {
|
||||||
|
LOG_LEVEL = "info";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
68
modules/networking/core.nix
Normal file
68
modules/networking/core.nix
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.network;
|
||||||
|
in {
|
||||||
|
options.network = {
|
||||||
|
firewall = {
|
||||||
|
enable = lib.mkEnableOption "system firewall";
|
||||||
|
tcpPorts = {
|
||||||
|
ssh.enable = lib.mkEnableOption "SSH service port (22)";
|
||||||
|
web.enable = lib.mkEnableOption "common web service ports (80, 443)";
|
||||||
|
smtp.enable = lib.mkEnableOption "SMTP service ports (25, 465, 587)";
|
||||||
|
imap.enable = lib.mkEnableOption "IMAP service ports (143, 993)";
|
||||||
|
mysql.enable = lib.mkEnableOption "MySQL service port (3306)";
|
||||||
|
mssql.enable = lib.mkEnableOption "Microsoft SQL Server service port (1433)";
|
||||||
|
postgres.enable = lib.mkEnableOption "Postgres service port (5432)";
|
||||||
|
allowedPorts = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.port;
|
||||||
|
default = [];
|
||||||
|
description = "List of custom TCP ports to open";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
udpPorts = {
|
||||||
|
dns.enable = lib.mkEnableOption "DNS service port (53)";
|
||||||
|
ntp.enable = lib.mkEnableOption "NTP service port (123)";
|
||||||
|
allowedPorts = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.port;
|
||||||
|
default = [];
|
||||||
|
description = "List of custom UDP ports to open";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
networkManager = {
|
||||||
|
enable = lib.mkEnableOption "NetworkManager for network connection management";
|
||||||
|
extraPlugins = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.package;
|
||||||
|
default = [];
|
||||||
|
description = "Additional NetworkManager plugins to install";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
networking.firewall = {
|
||||||
|
enable = cfg.firewall.enable;
|
||||||
|
allowedTCPPorts = lib.flatten [
|
||||||
|
(lib.optionals cfg.firewall.tcpPorts.ssh.enable [22])
|
||||||
|
(lib.optionals cfg.firewall.tcpPorts.web.enable [80 443])
|
||||||
|
(lib.optionals cfg.firewall.tcpPorts.smtp.enable [25 465 587])
|
||||||
|
(lib.optionals cfg.firewall.tcpPorts.imap.enable [143 993])
|
||||||
|
(lib.optionals cfg.firewall.tcpPorts.mysql.enable [3306])
|
||||||
|
(lib.optionals cfg.firewall.tcpPorts.mssql.enable [1433])
|
||||||
|
(lib.optionals cfg.firewall.tcpPorts.postgres.enable [5432])
|
||||||
|
cfg.firewall.tcpPorts.allowedPorts
|
||||||
|
];
|
||||||
|
allowedUDPPorts = lib.flatten [
|
||||||
|
(lib.optionals cfg.firewall.udpPorts.dns.enable [53])
|
||||||
|
(lib.optionals cfg.firewall.udpPorts.ntp.enable [123])
|
||||||
|
cfg.firewall.udpPorts.allowedPorts
|
||||||
|
];
|
||||||
|
};
|
||||||
|
networking.networkmanager = {
|
||||||
|
enable = lib.mkForce cfg.networkManager.enable;
|
||||||
|
packages = cfg.networkManager.extraPlugins;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
109
modules/networking/dns.nix
Normal file
109
modules/networking/dns.nix
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.dns;
|
||||||
|
in {
|
||||||
|
options.dns = {
|
||||||
|
bind = {
|
||||||
|
enable = lib.mkEnableOption "BIND DNS server";
|
||||||
|
settings = {
|
||||||
|
interfaces = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = ["127.0.0.1"];
|
||||||
|
description = "Network interfaces BIND should listen on (IPv4)";
|
||||||
|
};
|
||||||
|
|
||||||
|
interfaces6 = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = ["::1"];
|
||||||
|
description = "Network interfaces BIND should listen on (IPv6)";
|
||||||
|
};
|
||||||
|
|
||||||
|
zones = lib.mkOption {
|
||||||
|
type = lib.types.listOf (lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Name of the DNS zone";
|
||||||
|
};
|
||||||
|
type = lib.mkOption {
|
||||||
|
type = lib.types.enum ["master" "slave"];
|
||||||
|
default = "master";
|
||||||
|
description = "Type of DNS zone";
|
||||||
|
};
|
||||||
|
file = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Path to zone file";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = [];
|
||||||
|
description = "DNS zones to configure";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = lib.mkOption {
|
||||||
|
type = lib.types.lines;
|
||||||
|
default = "";
|
||||||
|
description = "Additional BIND configuration options";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
technitium = {
|
||||||
|
enable = lib.mkEnableOption "Technitium DNS server";
|
||||||
|
settings = {
|
||||||
|
address = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "0.0.0.0";
|
||||||
|
description = "IP address Technitium should listen on";
|
||||||
|
};
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = 5380;
|
||||||
|
description = "Port for Technitium DNS server";
|
||||||
|
};
|
||||||
|
extraOptions = lib.mkOption {
|
||||||
|
type = lib.types.attrs;
|
||||||
|
default = {};
|
||||||
|
description = "Additional Technitium configuration options";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf cfg.bind.enable {
|
||||||
|
services.bind = {
|
||||||
|
enable = true;
|
||||||
|
listenOn = cfg.bind.settings.interfaces;
|
||||||
|
listenOnIpv6 = cfg.bind.settings.interfaces6;
|
||||||
|
zones =
|
||||||
|
map (zone: {
|
||||||
|
name = zone.name;
|
||||||
|
type = zone.type;
|
||||||
|
file = zone.file;
|
||||||
|
})
|
||||||
|
cfg.bind.settings.zones;
|
||||||
|
extraConfig = cfg.bind.settings.extraConfig;
|
||||||
|
};
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [53];
|
||||||
|
allowedUDPPorts = [53];
|
||||||
|
};
|
||||||
|
environment.systemPackages = [pkgs.bind];
|
||||||
|
})
|
||||||
|
|
||||||
|
(lib.mkIf cfg.technitium.enable {
|
||||||
|
services.technitium-dns-server = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
firewallTCPPorts = [53 5380 53443];
|
||||||
|
firewallUDPPorts = [53];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
48
modules/pwrMgmt/README.md
Normal file
48
modules/pwrMgmt/README.md
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# Power management modules
|
||||||
|
|
||||||
|
This directory houses my own custom defined power management settings. These are set in the machine-specific configurations (typically).
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
Given that this configuration is in the `machine/<hostname>` directory (where hostname is the name of the computer your configuring):
|
||||||
|
|
||||||
|
### Desktop configuration
|
||||||
|
|
||||||
|
```nix
|
||||||
|
imports = [
|
||||||
|
../../pwrMgmt
|
||||||
|
# other configuration files here...
|
||||||
|
];
|
||||||
|
|
||||||
|
customPowerManagement = {
|
||||||
|
enable = true;
|
||||||
|
cpuFreqGovernor = "performance";
|
||||||
|
powertop.enable = false;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Laptop configuration
|
||||||
|
|
||||||
|
```nix
|
||||||
|
imports = [
|
||||||
|
../../pwrMgmt
|
||||||
|
# other configuration files here...
|
||||||
|
];
|
||||||
|
|
||||||
|
customPowerManagement = {
|
||||||
|
enable = true;
|
||||||
|
cpuFreqGovernor = "powersave";
|
||||||
|
powertop = {
|
||||||
|
enable = true;
|
||||||
|
autotuneOnBoot = true;
|
||||||
|
};
|
||||||
|
battery = {
|
||||||
|
enable = true;
|
||||||
|
startChargeThreshold = 40;
|
||||||
|
stopChargeThreshold = 75;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Remember, these are just examples. Please suit these examples to fit your specific hardware.
|
69
modules/pwrMgmt/default.nix
Normal file
69
modules/pwrMgmt/default.nix
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.pwrMgmt;
|
||||||
|
in {
|
||||||
|
options.pwrMgmt = {
|
||||||
|
enable = lib.mkEnableOption "Custom power management configuration";
|
||||||
|
cpuFreqGovernor = lib.mkOption {
|
||||||
|
type = lib.types.enum [
|
||||||
|
"performance"
|
||||||
|
"powersave"
|
||||||
|
"ondemand"
|
||||||
|
"conservative"
|
||||||
|
];
|
||||||
|
default = "performance";
|
||||||
|
description = "CPU frequency scaling governor to use";
|
||||||
|
};
|
||||||
|
|
||||||
|
powertop = {
|
||||||
|
enable = lib.mkEnableOption "PowerTop power management tool";
|
||||||
|
|
||||||
|
autotuneOnBoot = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Automatically tune power settings on boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
battery = {
|
||||||
|
enable = lib.mkEnableOption "Battery-specific power management";
|
||||||
|
|
||||||
|
startChargeThreshold = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 20;
|
||||||
|
description = "Percentage at which to start charging";
|
||||||
|
};
|
||||||
|
|
||||||
|
stopChargeThreshold = lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
default = 80;
|
||||||
|
description = "Percentage at which to stop charging";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
powerManagement = {
|
||||||
|
enable = true;
|
||||||
|
cpuFreqGovernor = cfg.cpuFreqGovernor;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = lib.mkIf cfg.powertop.enable [pkgs.powertop];
|
||||||
|
systemd.services.battery-charge-threshold = lib.mkIf cfg.battery.enable {
|
||||||
|
description = "Set battery charge thresholds";
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
script = ''
|
||||||
|
if [ -f /sys/class/power_supply/BAT0/charge_start_threshold ]; then
|
||||||
|
echo ${toString cfg.battery.startChargeThreshold} > /sys/class/power_supply/BAT0/charge_start_threshold
|
||||||
|
fi
|
||||||
|
if [ -f /sys/class/power_supply/BAT0/charge_stop_threshold ]; then
|
||||||
|
echo ${toString cfg.battery.stopChargeThreshold} > /sys/class/power_supply/BAT0/charge_stop_threshold
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
19
modules/sound/README.md
Normal file
19
modules/sound/README.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Sound and audio modules
|
||||||
|
|
||||||
|
This directory houses all sound and audio modules for a given system.
|
||||||
|
|
||||||
|
## Pipewire
|
||||||
|
|
||||||
|
Pipewire is the new kid on the block, and frankly, this new kid cleans the streets. With Pulseaudio and ALSA compatibility, this is basically the _defacto_ audio solution for every Linux workstation.
|
||||||
|
|
||||||
|
Although, for some use cases, expect me to write a Pulseaudio or an ALSA module here soon :P
|
||||||
|
|
||||||
|
All that's needed to get this working to import the `./pipewire.nix` into your machine's configuration.
|
||||||
|
|
||||||
|
## Shairport
|
||||||
|
|
||||||
|
This is a program where your computer is enabled with AirPlay! How cool is that??
|
||||||
|
|
||||||
|
All that's needed to get this working to import the `./shairport.nix` into your machine's configuration.
|
||||||
|
|
||||||
|
Note that this _only_ works with Pipewire.
|
6
modules/sound/pipewire.nix
Normal file
6
modules/sound/pipewire.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{...}: {
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
}
|
7
modules/sound/shairport.nix
Normal file
7
modules/sound/shairport.nix
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
services.shairport-sync = {
|
||||||
|
enable = pkgs.stdenv.isLinux;
|
||||||
|
openFirewall = pkgs.stdenv.isLinux;
|
||||||
|
arguments = "-v -o pw";
|
||||||
|
};
|
||||||
|
}
|
51
modules/virtualization/README.md
Normal file
51
modules/virtualization/README.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# Virtualization modules
|
||||||
|
|
||||||
|
This directory houses all virtualization and container related enablement. Cloud native anyone??
|
||||||
|
|
||||||
|
## Hardware virtualization
|
||||||
|
|
||||||
|
This is for running virtual machines on the bare metal.
|
||||||
|
|
||||||
|
All that's needed to get this working to import the `./hardware.nix` into your machine's configuration.
|
||||||
|
|
||||||
|
## Docker (OCI containers)
|
||||||
|
|
||||||
|
This is for running the Docker runtime (rootful or rootless, rootful by default) to run OCI containers.
|
||||||
|
|
||||||
|
All that's needed to get this working to import the `./docker.nix` into your machine's configuration.
|
||||||
|
|
||||||
|
Note: I don't use Docker too much as I use Podman for development. I'd check the Podman documentation.
|
||||||
|
|
||||||
|
## Podman/Buildah (OCI containers)
|
||||||
|
|
||||||
|
This is for running the Podman runtime (rootless) to run OCI containers.
|
||||||
|
|
||||||
|
You will need to import `./podman.nix` into your machine configuration. Additionally, there's some added configuration to suit your needs.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
podman = {
|
||||||
|
podman = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
docker-credential-helpers
|
||||||
|
toolbox
|
||||||
|
cosign
|
||||||
|
crane
|
||||||
|
podman-tui
|
||||||
|
podman-desktop
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
To get a full, comprehensive list of what you can do with the podman module, please check out (podman.nix)[./podman.nix]!
|
||||||
|
|
||||||
|
## Kubernetes
|
||||||
|
|
||||||
|
Coming soon!
|
||||||
|
|
||||||
|
## LXC/LXD
|
||||||
|
|
||||||
|
I don't have anything in the way of a nix configuration for LXC/LXD as I don't have a use-case for them. Come back later!
|
7
modules/virtualization/docker.nix
Normal file
7
modules/virtualization/docker.nix
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{...}: {
|
||||||
|
virtualisation.docker = {
|
||||||
|
enable = true;
|
||||||
|
enableOnBoot = true;
|
||||||
|
rootless = false;
|
||||||
|
};
|
||||||
|
}
|
4
modules/virtualization/hardware.nix
Normal file
4
modules/virtualization/hardware.nix
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{...}: {
|
||||||
|
virtualisation.libvirtd.enable = true;
|
||||||
|
programs.virt-manager.enable = true;
|
||||||
|
}
|
32
modules/virtualization/podman.nix
Normal file
32
modules/virtualization/podman.nix
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.podman;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
podman = {
|
||||||
|
enable = lib.mkEnableOption "Podman container runtime";
|
||||||
|
|
||||||
|
extraPackages = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.package;
|
||||||
|
default = [];
|
||||||
|
description = "Additional container-related packages to install";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages =
|
||||||
|
[
|
||||||
|
pkgs.podman
|
||||||
|
pkgs.podman-compose
|
||||||
|
pkgs.buildah
|
||||||
|
pkgs.skopeo
|
||||||
|
pkgs.dive
|
||||||
|
]
|
||||||
|
++ cfg.extraPackages;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user