Compare commits

..

8 Commits

16 changed files with 480 additions and 103 deletions

209
flake.lock generated
View File

@@ -20,11 +20,11 @@
]
},
"locked": {
"lastModified": 1770411700,
"narHash": "sha256-VpeOlyospHF+vxE+xEGEy0utMN0d/FUDvD2dOg9ZiIo=",
"lastModified": 1773436376,
"narHash": "sha256-OUPRrprbgN27BXHuWkMAPSCfLLQ/uwpWghEfKYN2iAg=",
"owner": "hyprwm",
"repo": "aquamarine",
"rev": "b91f570bb7885df9e4a512d6e95a13960a5bdca0",
"rev": "43f10d24391692bba3d762931ee35e7f17f8e8b8",
"type": "github"
},
"original": {
@@ -42,11 +42,11 @@
]
},
"locked": {
"lastModified": 1769805770,
"narHash": "sha256-gTSS83rAxZU2VYjgmxrbWEnFxk7OMEQFf38omYi2wQw=",
"lastModified": 1773237019,
"narHash": "sha256-86wsDo6d4+pyETbjHTwTQ9w7YYGAuq7SVaN7BzH992w=",
"owner": "polygon",
"repo": "audio.nix",
"rev": "3b0ad654379d080f7ddc98e9de6ff9eedaa20d2d",
"rev": "0c1b594b941dd46b29da107f03dfc91b34d820dd",
"type": "github"
},
"original": {
@@ -55,6 +55,26 @@
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1773889306,
"narHash": "sha256-PAqwnsBSI9SVC2QugvQ3xeYCB0otOwCacB1ueQj2tgw=",
"owner": "nix-community",
"repo": "disko",
"rev": "5ad85c82cc52264f4beddc934ba57f3789f28347",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"dzgui-nix": {
"inputs": {
"nixpkgs": [
@@ -107,11 +127,11 @@
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1770609827,
"narHash": "sha256-5J3I/ERia1xhWkPwugnpbucAE8lI5ip2ohTZ3xK2HrY=",
"lastModified": 1773892995,
"narHash": "sha256-kRGAztxZcaErtp4FoXnKgOX0OebUdkAIoSXRU1fybKA=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "60b2a2d7633b61981a694ad30bc1b19b64a949f1",
"rev": "394a8d49da42d2a63e8845c7262c636051f0f823",
"type": "gitlab"
},
"original": {
@@ -138,6 +158,22 @@
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1746162366,
@@ -182,11 +218,11 @@
]
},
"locked": {
"lastModified": 1770260404,
"narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=",
"lastModified": 1773681845,
"narHash": "sha256-o8hrZrigP0JYcwnglCp8Zi8jQafWsxbDtRRPzuVwFxY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b",
"rev": "0759e0e137305bc9d0c52c204c6d8dffe6f601a6",
"type": "github"
},
"original": {
@@ -212,11 +248,11 @@
]
},
"locked": {
"lastModified": 1753964049,
"narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=",
"lastModified": 1772461003,
"narHash": "sha256-pVICsV7FtcEeVwg5y/LFh3XFUkVJninm/P1j/JHzEbM=",
"owner": "hyprwm",
"repo": "hyprcursor",
"rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5",
"rev": "b62396457b9cfe2ebf24fe05404b09d2a40f8ed7",
"type": "github"
},
"original": {
@@ -241,11 +277,11 @@
]
},
"locked": {
"lastModified": 1770511807,
"narHash": "sha256-suKmSbSk34uPOJDTg/GbPrKEJutzK08vj0VoTvAFBCA=",
"lastModified": 1772461523,
"narHash": "sha256-mI6A51do+hEUzeJKk9YSWfVHdI/SEEIBi2tp5Whq5mI=",
"owner": "hyprwm",
"repo": "hyprgraphics",
"rev": "7c75487edd43a71b61adb01cae8326d277aab683",
"rev": "7d63c04b4a2dd5e59ef943b4b143f46e713df804",
"type": "github"
},
"original": {
@@ -273,11 +309,11 @@
"xdph": "xdph"
},
"locked": {
"lastModified": 1770641595,
"narHash": "sha256-eeu1HrA9dW1DHxPuIZcZ8giUi1BcrvjGkVV1Bx3vEzk=",
"lastModified": 1773926276,
"narHash": "sha256-dasCo1RATJvJWjPaVkbXPvjbWE+4f69bnRNGwtsh7Ao=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "f16ebef00366d2f85499196b9c7fb702b9f1c547",
"rev": "ad46ff635bcf7b4877b03e97d8e85468f025f4a1",
"type": "github"
},
"original": {
@@ -319,11 +355,11 @@
]
},
"locked": {
"lastModified": 1767023960,
"narHash": "sha256-R2HgtVS1G3KSIKAQ77aOZ+Q0HituOmPgXW9nBNkpp3Q=",
"lastModified": 1772467975,
"narHash": "sha256-kipyuDBxrZq+beYpZqWzGvFWm4QbayW9agAvi94vDXY=",
"owner": "hyprwm",
"repo": "hyprland-guiutils",
"rev": "c2e906261142f5dd1ee0bfc44abba23e2754c660",
"rev": "5e1c6b9025aaf4d578f3eff7c0eb1f0c197a9507",
"type": "github"
},
"original": {
@@ -349,11 +385,11 @@
]
},
"locked": {
"lastModified": 1769285097,
"narHash": "sha256-eVD4U3Oqzz0VU9ylJ5wo76xDcYKv2CpiiRXq4Is4QdA=",
"lastModified": 1771865848,
"narHash": "sha256-xwNa+1D8WPsDnJtUofDrtyDCZKZotbUymzV/R5s+M0I=",
"owner": "hyprwm",
"repo": "hyprland-plugins",
"rev": "06c0749a0dac978d89b1a76ae6adc76a3c15dbfa",
"rev": "b85a56b9531013c79f2f3846fd6ee2ff014b8960",
"type": "github"
},
"original": {
@@ -374,11 +410,11 @@
]
},
"locked": {
"lastModified": 1765214753,
"narHash": "sha256-P9zdGXOzToJJgu5sVjv7oeOGPIIwrd9hAUAP3PsmBBs=",
"lastModified": 1772460177,
"narHash": "sha256-/6G/MsPvtn7bc4Y32pserBT/Z4SUUdBd4XYJpOEKVR4=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "3f3860b869014c00e8b9e0528c7b4ddc335c21ab",
"rev": "1cb6db5fd6bb8aee419f4457402fa18293ace917",
"type": "github"
},
"original": {
@@ -403,11 +439,11 @@
]
},
"locked": {
"lastModified": 1767983607,
"narHash": "sha256-8C2co8NYfR4oMOUEsPROOJ9JHrv9/ktbJJ6X1WsTbXc=",
"lastModified": 1772459629,
"narHash": "sha256-/iwvNUYShmmnwmz/czEUh6+0eF5vCMv0xtDW0STPIuM=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "d4037379e6057246b408bbcf796cf3e9838af5b2",
"rev": "7615ee388de18239a4ab1400946f3d0e498a8186",
"type": "github"
},
"original": {
@@ -455,11 +491,11 @@
]
},
"locked": {
"lastModified": 1764592794,
"narHash": "sha256-7CcO+wbTJ1L1NBQHierHzheQGPWwkIQug/w+fhTAVuU=",
"lastModified": 1772462885,
"narHash": "sha256-5pHXrQK9zasMnIo6yME6EOXmWGFMSnCITcfKshhKJ9I=",
"owner": "hyprwm",
"repo": "hyprtoolkit",
"rev": "5cfe0743f0e608e1462972303778d8a0859ee63e",
"rev": "9af245a69fa6b286b88ddfc340afd288e00a6998",
"type": "github"
},
"original": {
@@ -480,11 +516,11 @@
]
},
"locked": {
"lastModified": 1770139857,
"narHash": "sha256-bCqxcXjavgz5KBJ/1CBLqnagMMf9JvU1m9HmYVASKoc=",
"lastModified": 1773436263,
"narHash": "sha256-n+2xFJngUkBqUJD5FsbVnYEHBTyDFSqtBIwQIGPXWWo=",
"owner": "hyprwm",
"repo": "hyprutils",
"rev": "9038eec033843c289b06b83557a381a2648d8fa5",
"rev": "5e228db6821380a5875d5643176c5c46a47b8134",
"type": "github"
},
"original": {
@@ -505,11 +541,11 @@
]
},
"locked": {
"lastModified": 1770501770,
"narHash": "sha256-NWRM6+YxTRv+bT9yvlhhJ2iLae1B1pNH3mAL5wi2rlQ=",
"lastModified": 1772459835,
"narHash": "sha256-978jRz/y/9TKmZb/qD4lEYHCQGHpEXGqy+8X2lFZsak=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
"rev": "0bd8b6cde9ec27d48aad9e5b4deefb3746909d40",
"rev": "0a692d4a645165eebd65f109146b8861e3a925e7",
"type": "github"
},
"original": {
@@ -534,11 +570,11 @@
]
},
"locked": {
"lastModified": 1770203293,
"narHash": "sha256-PR/KER+yiHabFC/h1Wjb+9fR2Uy0lWM3Qld7jPVaWkk=",
"lastModified": 1773074819,
"narHash": "sha256-qRqYnXiKoJLRTcfaRukn7EifmST2IVBUMZOeZMAc5UA=",
"owner": "hyprwm",
"repo": "hyprwire",
"rev": "37bc90eed02b0c8b5a77a0b00867baf3005cfb98",
"rev": "f68afd0e73687598cc2774804fedad76693046f0",
"type": "github"
},
"original": {
@@ -615,12 +651,34 @@
"type": "github"
}
},
"nixos-cosmic": {
"nix-minecraft": {
"inputs": {
"flake-compat": "flake-compat_2",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_2"
},
"locked": {
"lastModified": 1774407052,
"narHash": "sha256-rUkn7Bo3PAlpcZl8+0FDsTwFyDwvS4xwMT9+RJ+XJoE=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "70daf1f48885f0b4a70797076cd2ff5d9139b46e",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat_3",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable",
"rust-overlay": "rust-overlay_2"
},
@@ -640,11 +698,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1770631810,
"narHash": "sha256-b7iK/x+zOXbjhRqa+XBlYla4zFvPZyU5Ln2HJkiSnzc=",
"lastModified": 1773533765,
"narHash": "sha256-qonGfS2lzCgCl59Zl63jF6dIRRpvW3AJooBGMaXjHiY=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "2889685785848de940375bf7fea5e7c5a3c8d502",
"rev": "f8e82243fd601afb9f59ad230958bd073795cbfe",
"type": "github"
},
"original": {
@@ -656,11 +714,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1770464364,
"narHash": "sha256-z5NJPSBwsLf/OfD8WTmh79tlSU8XgIbwmk6qB1/TFzY=",
"lastModified": 1773814637,
"narHash": "sha256-GNU+ooRmrHLfjlMsKdn0prEKVa0faVanm0jrgu1J/gY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "23d72dabcb3b12469f57b37170fcbc1789bd7457",
"rev": "fea3b367d61c1a6592bc47c72f40a9f3e6a53e96",
"type": "github"
},
"original": {
@@ -688,11 +746,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1770562336,
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
"lastModified": 1773821835,
"narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
"rev": "b40629efe5d6ec48dd1efba650c797ddbd39ace0",
"type": "github"
},
"original": {
@@ -712,11 +770,11 @@
]
},
"locked": {
"lastModified": 1769956244,
"narHash": "sha256-12RCFLyAedyMOdenUi7cN3ioJPEGjA/ZG1BLjugfUVs=",
"lastModified": 1772361940,
"narHash": "sha256-B1Cz+ydL1iaOnGlwOFld/C8lBECPtzhiy/pP93/CuyY=",
"owner": "pjones",
"repo": "plasma-manager",
"rev": "fe54ea85c6e4413fba03b84d50f2b431d2f7c831",
"rev": "a4b33606111c9c5dcd10009042bb710307174f51",
"type": "github"
},
"original": {
@@ -735,11 +793,11 @@
]
},
"locked": {
"lastModified": 1769939035,
"narHash": "sha256-Fok2AmefgVA0+eprw2NDwqKkPGEI5wvR+twiZagBvrg=",
"lastModified": 1772893680,
"narHash": "sha256-JDqZMgxUTCq85ObSaFw0HhE+lvdOre1lx9iI6vYyOEs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "a8ca480175326551d6c4121498316261cbb5b260",
"rev": "8baab586afc9c9b57645a734c820e4ac0a604af9",
"type": "github"
},
"original": {
@@ -751,11 +809,13 @@
"root": {
"inputs": {
"audio": "audio",
"disko": "disko",
"dzgui-nix": "dzgui-nix",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager",
"hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins",
"nix-minecraft": "nix-minecraft",
"nixos-cosmic": "nixos-cosmic",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
@@ -831,11 +891,11 @@
]
},
"locked": {
"lastModified": 1770526836,
"narHash": "sha256-xbvX5Ik+0inJcLJtJ/AajAt7xCk6FOCrm5ogpwwvVDg=",
"lastModified": 1773889674,
"narHash": "sha256-+ycaiVAk3MEshJTg35cBTUa0MizGiS+bgpYw/f8ohkg=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "d6e0e666048a5395d6ea4283143b7c9ac704720d",
"rev": "29b6519f3e0780452bca0ac0be4584f04ac16cc5",
"type": "github"
},
"original": {
@@ -859,6 +919,21 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
@@ -887,11 +962,11 @@
]
},
"locked": {
"lastModified": 1761431178,
"narHash": "sha256-xzjC1CV3+wpUQKNF+GnadnkeGUCJX+vgaWIZsnz9tzI=",
"lastModified": 1772669058,
"narHash": "sha256-XhnY0aRuDo5LT8pmJVPofPOgO2hAR7T+XRoaQxtNPzQ=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "4b8801228ff958d028f588f0c2b911dbf32297f9",
"rev": "906d0ac159803a7df2dc1f948df9327670380f69",
"type": "github"
},
"original": {

View File

@@ -13,6 +13,8 @@
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
plasma-manager = {
url = "github:pjones/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
@@ -42,6 +44,8 @@
url = "github:polygon/audio.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
@@ -74,6 +78,8 @@
({...}: {nixpkgs.config.allowUnfree = true;})
nixos-hardware.nixosModules.msi-b550-a-pro
inputs.sops-nix.nixosModules.sops
inputs.nix-minecraft.overlay
inputs.nix-minecraft.nixosModules.minecraft-servers
./modules
./hosts/comfy-station/configuration.nix
];
@@ -90,6 +96,7 @@
overlay-unstable
self.overlays.default
audio.overlays.default
inputs.nix-minecraft.overlay
];
})
({...}: {
@@ -105,6 +112,7 @@
nixos-hardware.nixosModules.lenovo-thinkpad-t14-amd-gen1
inputs.sops-nix.nixosModules.sops
nixos-cosmic.nixosModules.default
inputs.nix-minecraft.nixosModules.minecraft-servers
./fixes/plasma-fix.nix
./modules
./hosts/monolith/configuration.nix
@@ -117,9 +125,18 @@
isHM = false;
};
modules = [
({...}: {nixpkgs.overlays = [overlay-unstable self.overlays.default audio.overlays.default];})
({...}: {
nixpkgs.overlays = [
overlay-unstable
self.overlays.default
audio.overlays.default
inputs.nix-minecraft.overlay
];
})
({...}: {nixpkgs.config.allowUnfree = true;})
inputs.sops-nix.nixosModules.sops
inputs.disko.nixosModules.disko
inputs.nix-minecraft.nixosModules.minecraft-servers
./modules
./hosts/harbor/configuration.nix
];
@@ -238,6 +255,10 @@
Before running nix build, make sure to run `cargo generate-lockfile` first.
'';
};
cmake-c = {
path = ./templates/cmake-c;
description = "A simple cmake c project.";
};
};
};
}

View File

@@ -5,6 +5,7 @@
}: {
imports = [
./hardware-configuration.nix
./disko.nix
];
# Secret management
@@ -66,6 +67,7 @@
# hive modules
hive.gitea-instance.enable = true;
hive.gitea-instance.nativeRunner = true;
hive.gitea-instance.instanceFQDN = "git.jroeger.de";
hive.gitea-instance.databasePasswordFile = config.sops.secrets.gitea-db-pass.path;
hive.gotify-instance.enable = true;
@@ -87,13 +89,16 @@
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
system.stateVersion = "25.11"; # Did you read the comment?
# VPS compat
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.version = 2;
boot.kernelParams = ["net.ifnames=0"]; # ensure iface is called eth0
boot.kernelParams = [
"net.ifnames=0" # ensure iface is called eth0
"ip=173.249.42.252::173.249.42.1:255.255.255.0:harbor:eth0:none:8.8.8.8"
];
networking.networkmanager.enable = true;
networking = {
# Static network configuration
@@ -108,6 +113,22 @@
}
];
};
# Temporary ssh server for disk unlock
boot.initrd = {
availableKernelModules = ["virtio_pci"];
network = {
enable = true;
ssh = {
enable = true;
port = 2222;
authorizedKeys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyCyYsMSiy7shcehlzJEbCyRiHk+cicFB35Bc2uc4PjjkCjswLh01fRAV2QcplrNkH/5F4GBTbOoZHHc7/AVLyUxgwDC9ffD2i7fevuGpfBFy9D30uz6jDekxXkmRmIlidXLdG1Fh4zwVejGlwdhUu/Zb7PonO/dktx3EFdf1SpnW+y75anN85zoGsld7KQk42wEd0zXtCgx4CKI6Vvt6heWCEiJ9wyw1sLpTJr4H8In236CUj1/r1qY9Gfa8n9NA0J9XCpcwSCEWGRKQNicoQIpnp5txrgzaUq4r6qBKHmImYXmSTVnDZ9dJLRYNu2lDvBtTXP4ztlR6Lpxs873fPg51qgaX9rRVMMo/gGjq8fOFWsDVaJZab9VY3hZYNCKIbWFqo4GKyCQs9Xfzr2AUACm09HWiYMTefwEypOzvUb4z+LF2B/0c5XmghLF/TOzLVgDXzAgWMH4mCnPh9EDLHTtoJaGNURler9VRV8yQyLH6oK9UpHZovCFs7HpFN+WPv2QVFfkK8aHg7tnklFsT78z154bjuspiEI/fFGmTxoQUGufmHlRy/9GQDusgNfe24ZEB2hHBVjKv29XdIfvFAhoPVpA6+O/N3feSlmVISaU+8QraVQEf/TuQjopDUWpJTmqSxKvQSTPwcyWDy6NtcJ85bGAu6jSUGC3ouH4Rb2Q== cardno:000609618602"
];
hostKeys = ["/etc/secrets/initrd/ssh_host_rsa_key"];
shell = "/bin/cryptsetup-askpass";
};
};
};
# Set your time zone.
time.timeZone = "Europe/Berlin";

71
hosts/harbor/disko.nix Normal file
View File

@@ -0,0 +1,71 @@
let
btrfsopt = [
"compress=zstd"
"noatime"
"ssd"
"space_cache=v2"
"user_subvol_rm_allowed"
];
in {
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "ef02";
};
esp = {
name = "esp";
size = "500M";
type = "ef00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "nixos";
passwordFile = "/tmp/pass";
additionalKeyFiles = ["/nixos-enc.key"];
extraFormatArgs = [
"--type luks1"
"--iter-time 3000"
];
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
subvolumes = {
"@root" = {
mountpoint = "/";
mountOptions = btrfsopt;
};
"@home" = {
mountpoint = "/home";
mountOptions = btrfsopt;
};
"@nix" = {
mountpoint = "/nix";
mountOptions = btrfsopt;
};
};
};
};
};
};
};
};
};
};
}

View File

@@ -12,35 +12,10 @@
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod"];
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/a9ac5007-f148-4001-ba49-f6a0bfad85cc";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/12CE-A600";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [
{
device = "/.swapfile";
size = 2 * 1024;
}
];
# 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.ens18.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View File

@@ -31,6 +31,7 @@
./services/gitea-instance.nix
./services/gotify-instance.nix
./services/kdeconnect.nix
./services/minecraft-server
./services/nextcloud-instance.nix
./services/virt-manager.nix
]

View File

@@ -15,6 +15,7 @@ in {
config = lib.mkIf cfg.enable {
programs.firefox = {
enable = true;
nativeMessagingHosts = lib.optional cfg.passFF pkgs.passff-host;
# Default profile
profiles.jonas = {
@@ -91,8 +92,5 @@ in {
++ lib.optional cfg.passFF passff);
};
};
home.packages =
lib.optional cfg.passFF
pkgs.passff-host;
};
}

View File

@@ -19,6 +19,11 @@ in {
example = "/etc/gitea-db-pass.txt";
description = "Path to the file containing the Gitea database password";
};
nativeRunner = lib.mkOption {
type = lib.types.bool;
description = "Install a gitea act_runner using the native nix store";
default = false;
};
};
config = lib.mkIf cfg.enable {
@@ -68,5 +73,51 @@ in {
}
];
};
# act_runner
services.gitea-actions-runner = lib.mkIf cfg.nativeRunner {
instances.nixos-host = {
enable = true;
name = "nixos-host-runner";
url = "https://${cfg.instanceFQDN}";
tokenFile = "/var/lib/gitea-registration/nixos-host";
labels = ["nixos:host"];
settings = {
runner = {
capacity = 1;
};
};
};
};
systemd.services.gitea-runner-nixos-host = lib.mkIf cfg.nativeRunner {
after = ["gitea-runner-gen-token.service"];
requires = ["gitea-runner-gen-token.service"];
serviceConfig.Environment = ''
PATH=/run/current-system/sw/bin:/usr/bin:/bin
'';
};
systemd.services.gitea-runner-gen-token = lib.mkIf cfg.nativeRunner {
wantedBy = ["multi-user.target"];
after = ["gitea.service"];
environment = {
GITEA_CUSTOM = "/var/lib/gitea/custom";
GITEA_WORK_DIR = "/var/lib/gitea";
};
script = ''
set -euo pipefail
token=$(${config.services.gitea.package}/bin/gitea actions generate-runner-token)
echo "TOKEN=$token" > /var/lib/gitea-registration/nixos-host
'';
unitConfig.ConditionPathExists = ["!/var/lib/gitea-registration/nixos-host"];
serviceConfig = {
User = "gitea";
Group = "gitea";
StateDirectory = "gitea-registration";
Type = "oneshot";
RemainAfterExit = true;
};
};
};
}

View File

@@ -0,0 +1,39 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.hive.services.minecraft-server;
modpack = pkgs.callPackage ./loadCurseForge.nix {
url = "https://mediafilez.forgecdn.net/files/7765/203/BMC3_Server_Pack_v44.zip";
hash = "";
};
mcVersion = modpack.variables.MINECRAFT_VERSION;
loader = lib.toLower modpack.variables.MODLOADER;
loaderVersion = modpack.variables.MODLOADER_VERSION;
serverVersion = lib.replaceStrings ["."] ["_"] "${loader}-${mcVersion}";
in {
options.hive.services.minecraft-server = {
enable = lib.mkEnableOption "Enable BMC3 server";
};
config = lib.mkIf cfg.enable {
services.minecraft-servers.servers.bmc3 =
{
enable = true;
eula = true;
}
# Prevent download of modpack if not enabled
// (lib.optionalAttrs cfg.enable {
package = pkgs."${loader}Servers".${serverVersion}.override {inherit loaderVersion;};
jvmOpts = modpack.variables.JAVA_ARGS;
symlinks = {
"mods" = modpack.mods;
"config" = modpack.config;
};
});
};
}

View File

@@ -0,0 +1,36 @@
{
url ? null,
hash ? null,
pkgs,
lib,
...
}: let
modpack = pkgs.fetchzip {
inherit url hash;
stripRoot = false;
};
variablesStr = builtins.readFile "${modpack}/variables.txt";
variableLines =
builtins.filter (l: l != "" && (lib.strings.elemAt (lib.stringToCharacters l) 0) != "#")
(lib.strings.splitString "\n" variablesStr);
stripQuotes = s:
if builtins.match "^\".*\"$" s != null
then builtins.substring 1 (builtins.stringLength s - 2) s
else s;
parseLine = line: let
parts = lib.strings.splitString "=" line;
in {
name = builtins.elemAt parts 0;
value = stripQuotes (builtins.concatStringsSep "=" (builtins.tail parts));
};
variables = builtins.listToAttrs (map parseLine variableLines);
in {
inherit variables;
root = modpack;
mods = "${modpack}/mods";
config = "${modpack}/config";
}

View File

@@ -32,7 +32,7 @@ in {
services.nextcloud = {
# Instance
enable = true;
package = pkgs.nextcloud31;
package = pkgs.nextcloud33;
hostName = cfg.instanceFQDN;
https = cfg.ssl;
configureRedis = true;
@@ -55,12 +55,11 @@ in {
(config.services.nextcloud.package.packages.apps)
calendar
contacts
maps
tasks
;
drop_account = pkgs.fetchNextcloudApp {
sha256 = "sha256-AAWAR5i8moGlyGMaNqJwQPqPAHqWvIf4mvZ4U0dfg/A=";
url = "https://packages.framasoft.org/projects/nextcloud-apps/drop-account/drop_account-2.7.1.tar.gz";
sha256 = "sha256-J+bZVNIb/MokuTYQu8RBKdnZFakh180pa1pW5KHlC80=";
url = "https://packages.framasoft.org/projects/nextcloud-apps/drop-account/drop_account-3.0.0.tar.gz";
license = "agpl3Only";
};
};

1
templates/cmake-c/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
build

View File

@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.15)
project(Hello
DESCRIPTION "Hello World"
LANGUAGES C
)
add_executable(hello src/main.c)
install(TARGETS hello)

View File

@@ -0,0 +1,56 @@
{
description = "Cmake C Flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs @ {
self,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} (
top: {
imports = [];
flake = {
overlays.default = final: prev: {
my-derivation = final.callPackage ./nix/derivation.nix {};
};
};
systems = [
"x86_64-linux"
];
perSystem = {
self',
pkgs,
system,
...
}: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [self.overlays.default];
};
packages.default = pkgs.my-derivation;
devShells.default = pkgs.mkShell {
packages = [
pkgs.cmake-language-server
pkgs.cmake-format
pkgs.clang-tools
pkgs.gdb
];
inputsFrom = [self'.packages.default];
shellHook = ''
export CMAKE_EXPORT_COMPILE_COMMANDS=ON
'';
};
};
}
);
}

View File

@@ -0,0 +1,17 @@
{
cmake,
stdenv,
...
}:
stdenv.mkDerivation (finalAttrs: {
pname = "my-derivation";
version = "0.1.0";
src = ../.;
nativeBuildInputs = [cmake];
buildInputs = [];
meta = {
description = "Hello World Binary";
mainProgram = "hello";
};
})

View File

@@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
puts("Hello, Flake!");
return 0;
}