forked from Drift/pvv-nixos-config
Compare commits
12 Commits
configure-
...
actions
Author | SHA1 | Date | |
---|---|---|---|
96affe4b0b | |||
7a0946fb1c | |||
05cac3cb93 | |||
b8f6aa2f62 | |||
9b44087693 | |||
59008d213c | |||
4fc7a16909
|
|||
1e841e0397 | |||
6e2876f67f | |||
6fd71598cb | |||
be341622fe | |||
87a7b17b49 |
28
.gitea/workflows/test.yml
Normal file
28
.gitea/workflows/test.yml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: "Test"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
jobs:
|
||||||
|
evals:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: apt-get update && apt-get -y install sudo
|
||||||
|
- uses: https://github.com/cachix/install-nix-action@v23
|
||||||
|
- run: echo -e "show-trace = true\nmax-jobs = auto\ntrusted-users = root\nexperimental-features = nix-command flakes\nbuild-users-group =" > /etc/nix/nix.conf
|
||||||
|
- run: nix flake check
|
||||||
|
builds:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: apt-get update && apt-get -y install sudo
|
||||||
|
- run: su node
|
||||||
|
- run: whoami
|
||||||
|
- uses: https://github.com/cachix/install-nix-action@v23
|
||||||
|
- run: echo -e "show-trace = true\nmax-jobs = auto\ntrusted-users = root\nexperimental-features = nix-command flakes\nbuild-users-group =" > /etc/nix/nix.conf
|
||||||
|
- run: nix build --keep-going .#nixosConfigurations.bekkalokk.config.system.build.toplevel || exit 0
|
||||||
|
# - run: nix build --keep-going .#nixosConfigurations.bicep.config.system.build.toplevel || exit 0
|
||||||
|
# - run: nix build --keep-going .#nixosConfigurations.brzeczyszczykiewicz.config.system.build.toplevel || exit 0
|
||||||
|
# - run: nix build --keep-going .#nixosConfigurations.georg.config.system.build.toplevel || exit 0
|
||||||
|
# - run: nix build --keep-going .#nixosConfigurations.ildkule.config.system.build.toplevel || exit 0
|
||||||
|
# - run: nix build --keep-going .#nixosConfigurations.shark.config.system.build.toplevel || exit 0
|
@@ -10,7 +10,13 @@ Etter å ha klonet prosjektet ned og gjort endringer kan du evaluere configene m
|
|||||||
|
|
||||||
før du bygger en maskin med:
|
før du bygger en maskin med:
|
||||||
|
|
||||||
`nix build .#nixosConfigurations.<maskinavn>.config.system.build.toplevel`
|
`nix build .#<maskinnavn>`
|
||||||
|
|
||||||
|
hvis du vil være ekstra sikker på at alt bygger så kan du kjøre:
|
||||||
|
|
||||||
|
`nix build .` for å bygge alle de viktige maskinene.
|
||||||
|
|
||||||
|
NB: Dette kan ta opp til 30 minutter avhengig av hva som ligger i caches
|
||||||
|
|
||||||
Husk å hvertfall stage nye filer om du har laget dem!
|
Husk å hvertfall stage nye filer om du har laget dem!
|
||||||
|
|
||||||
|
72
flake.lock
generated
72
flake.lock
generated
@@ -1,15 +1,55 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"grzegorz": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"unstable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696346665,
|
||||||
|
"narHash": "sha256-J6Tf6a/zhFZ8SereluHLrvgPsIVm2CGHHA8wrbhZB3Y=",
|
||||||
|
"owner": "Programvareverkstedet",
|
||||||
|
"repo": "grzegorz",
|
||||||
|
"rev": "9b9c3ac7d408ac7c6d67544b201e6b169afacb03",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Programvareverkstedet",
|
||||||
|
"repo": "grzegorz",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"grzegorz-clients": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1693864994,
|
||||||
|
"narHash": "sha256-oLDiWdCKDtEfeGzfAuDTq+n9VWp6JCo67PEESEZ3y8E=",
|
||||||
|
"owner": "Programvareverkstedet",
|
||||||
|
"repo": "grzegorz-clients",
|
||||||
|
"rev": "a38a0b0fb31ad0ad78a91458cb2c7f77f686468f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Programvareverkstedet",
|
||||||
|
"repo": "grzegorz-clients",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"matrix-next": {
|
"matrix-next": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694383459,
|
"lastModified": 1697420972,
|
||||||
"narHash": "sha256-Y7VuBz74Go1QlvSLGXsXzPgOeeV73bbsDou3uXX9oa8=",
|
"narHash": "sha256-eFDasOzXAN8VswUntNBBwvKFyVKFvmwRNNVTDfGdB3M=",
|
||||||
"owner": "dali99",
|
"owner": "dali99",
|
||||||
"repo": "nixos-matrix-modules",
|
"repo": "nixos-matrix-modules",
|
||||||
"rev": "66ff528912d95e6a2ee0aea6404a6b7e0d7fd83c",
|
"rev": "1e370b96223b94d52006249a60033caaea605c65",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -20,11 +60,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694526311,
|
"lastModified": 1697706247,
|
||||||
"narHash": "sha256-Y9LCYQBNX7McW0o8x6wT9tx2qy9TVuF84fe62zrQzyA=",
|
"narHash": "sha256-nWLggeUxn/l8JrcQr9f+RfnCXp8cn0BN568PjMJh9ko=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "36bee398beca22e2428074e0a2e068d87f801718",
|
"rev": "4ee5b576ac2861a818950aea99f609d7a6fc02a3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -51,11 +91,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1693675694,
|
"lastModified": 1697332183,
|
||||||
"narHash": "sha256-2pIOyQwGyy2FtFAUIb8YeKVmOCcPOTVphbAvmshudLE=",
|
"narHash": "sha256-ACYvYsgLETfEI2xM1jjp8ZLVNGGC0onoCGe+69VJGGE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5601118d39ca9105f8e7b39d4c221d3388c0419d",
|
"rev": "0e1cff585c1a85aeab059d3109f66134a8f76935",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -87,6 +127,8 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"grzegorz": "grzegorz",
|
||||||
|
"grzegorz-clients": "grzegorz-clients",
|
||||||
"matrix-next": "matrix-next",
|
"matrix-next": "matrix-next",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"pvv-calendar-bot": "pvv-calendar-bot",
|
"pvv-calendar-bot": "pvv-calendar-bot",
|
||||||
@@ -102,11 +144,11 @@
|
|||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694495315,
|
"lastModified": 1697339241,
|
||||||
"narHash": "sha256-sZEYXs9T1NVHZSSbMqBEtEm2PGa7dEDcx0ttQkArORc=",
|
"narHash": "sha256-ITsFtEtRbCBeEH9XrES1dxZBkE1fyNNUfIyQjQ2AYQs=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "ea208e55f8742fdcc0986b256bdfa8986f5e4415",
|
"rev": "51186b8012068c417dac7c31fb12861726577898",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -117,11 +159,11 @@
|
|||||||
},
|
},
|
||||||
"unstable": {
|
"unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1694534540,
|
"lastModified": 1697713104,
|
||||||
"narHash": "sha256-Cc0Ku0qJZDDx/0kII+0xD94L25EKw4EQzOLm0R9iZO4=",
|
"narHash": "sha256-DN7YOyKMCpAVeZ44N42LrujtTkoerkS9+kTufQiuntY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "f22a472661d66c655eae5b0a01ada71e4e13e405",
|
"rev": "6be2c349a30fcb489a3153dd331e9df387ab6449",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
50
flake.nix
50
flake.nix
@@ -12,16 +12,30 @@
|
|||||||
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
|
pvv-calendar-bot.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
matrix-next.url = "github:dali99/nixos-matrix-modules";
|
matrix-next.url = "github:dali99/nixos-matrix-modules";
|
||||||
|
|
||||||
|
grzegorz.url = "github:Programvareverkstedet/grzegorz";
|
||||||
|
grzegorz.inputs.nixpkgs.follows = "unstable";
|
||||||
|
grzegorz-clients.url = "github:Programvareverkstedet/grzegorz-clients";
|
||||||
|
grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, matrix-next, pvv-calendar-bot, unstable, sops-nix, ... }@inputs:
|
outputs = { self, nixpkgs, matrix-next, pvv-calendar-bot, unstable, sops-nix, ... }@inputs:
|
||||||
let
|
let
|
||||||
|
nixlib = nixpkgs.lib;
|
||||||
systems = [
|
systems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
];
|
];
|
||||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
forAllSystems = f: nixlib.genAttrs systems (system: f system);
|
||||||
|
allMachines = nixlib.mapAttrsToList (name: _: name) self.nixosConfigurations;
|
||||||
|
importantMachines = [
|
||||||
|
"bekkalokk"
|
||||||
|
"bicep"
|
||||||
|
"brzeczyszczykiewicz"
|
||||||
|
"georg"
|
||||||
|
"ildkule"
|
||||||
|
];
|
||||||
in {
|
in {
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate
|
nixosConfig = nixpkgs: name: config: nixpkgs.lib.nixosSystem (nixpkgs.lib.recursiveUpdate
|
||||||
@@ -58,7 +72,7 @@
|
|||||||
./hosts/bicep/configuration.nix
|
./hosts/bicep/configuration.nix
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
|
|
||||||
matrix-next.nixosModules.synapse
|
matrix-next.nixosModules.default
|
||||||
pvv-calendar-bot.nixosModules.default
|
pvv-calendar-bot.nixosModules.default
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -66,10 +80,42 @@
|
|||||||
ildkule = stableNixosConfig "ildkule" { };
|
ildkule = stableNixosConfig "ildkule" { };
|
||||||
#ildkule-unstable = unstableNixosConfig "ildkule" { };
|
#ildkule-unstable = unstableNixosConfig "ildkule" { };
|
||||||
shark = stableNixosConfig "shark" { };
|
shark = stableNixosConfig "shark" { };
|
||||||
|
|
||||||
|
brzeczyszczykiewicz = stableNixosConfig "brzeczyszczykiewicz" {
|
||||||
|
modules = [
|
||||||
|
./hosts/brzeczyszczykiewicz/configuration.nix
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
|
||||||
|
inputs.grzegorz.nixosModules.grzegorz-kiosk
|
||||||
|
inputs.grzegorz-clients.nixosModules.grzegorz-webui
|
||||||
|
];
|
||||||
|
};
|
||||||
|
georg = stableNixosConfig "georg" {
|
||||||
|
modules = [
|
||||||
|
./hosts/georg/configuration.nix
|
||||||
|
sops-nix.nixosModules.sops
|
||||||
|
|
||||||
|
inputs.grzegorz.nixosModules.grzegorz-kiosk
|
||||||
|
inputs.grzegorz-clients.nixosModules.grzegorz-webui
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells = forAllSystems (system: {
|
devShells = forAllSystems (system: {
|
||||||
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
packages = {
|
||||||
|
"x86_64-linux" = let
|
||||||
|
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||||
|
in rec {
|
||||||
|
default = important-machines;
|
||||||
|
important-machines = pkgs.linkFarm "important-machines"
|
||||||
|
(nixlib.getAttrs importantMachines self.packages.x86_64-linux);
|
||||||
|
all-machines = pkgs.linkFarm "all-machines"
|
||||||
|
(nixlib.getAttrs allMachines self.packages.x86_64-linux);
|
||||||
|
} // nixlib.genAttrs allMachines
|
||||||
|
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -84,9 +84,9 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers.gitea-import-users = {
|
systemd.timers.gitea-import-users = {
|
||||||
enable = true;
|
|
||||||
requires = [ "gitea.service" ];
|
requires = [ "gitea.service" ];
|
||||||
after = [ "gitea.service" ];
|
after = [ "gitea.service" ];
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "*-*-* 02:00:00";
|
OnCalendar = "*-*-* 02:00:00";
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
|
36
hosts/brzeczyszczykiewicz/configuration.nix
Normal file
36
hosts/brzeczyszczykiewicz/configuration.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{ config, pkgs, values, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../base.nix
|
||||||
|
../../misc/metrics-exporters.nix
|
||||||
|
|
||||||
|
../../modules/grzegorz.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "brzeczyszczykiewicz";
|
||||||
|
|
||||||
|
systemd.network.networks."30-eno1" = values.defaultNetworkConfig // {
|
||||||
|
matchConfig.Name = "eno1";
|
||||||
|
address = with values.hosts.brzeczyszczykiewicz; [ (ipv4 + "/25") (ipv6 + "/64") ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# List packages installed in system profile
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# 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 = "23.05"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
39
hosts/brzeczyszczykiewicz/hardware-configuration.nix
Normal file
39
hosts/brzeczyszczykiewicz/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" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/4e8667f8-55de-4103-8369-b94665f42204";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/82E3-3D03";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/d0bf9a21-44bc-44a3-ae55-8f0971875883"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
# 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;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
36
hosts/georg/configuration.nix
Normal file
36
hosts/georg/configuration.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{ config, pkgs, values, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../base.nix
|
||||||
|
../../misc/metrics-exporters.nix
|
||||||
|
|
||||||
|
../../modules/grzegorz.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "georg";
|
||||||
|
|
||||||
|
systemd.network.networks."30-eno1" = values.defaultNetworkConfig // {
|
||||||
|
matchConfig.Name = "eno1";
|
||||||
|
address = with values.hosts.georg; [ (ipv4 + "/25") (ipv6 + "/64") ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# List packages installed in system profile
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
# List services that you want to enable:
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# 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 = "23.05"; # Did you read the comment?
|
||||||
|
|
||||||
|
}
|
40
hosts/georg/hardware-configuration.nix
Normal file
40
hosts/georg/hardware-configuration.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# 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" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/33825f0d-5a63-40fc-83db-bfa1ebb72ba0";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/145E-7362";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/7ed27e21-3247-44cd-8bcc-5d4a2efebf57"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
# 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.enp2s2.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
62
modules/grzegorz.nix
Normal file
62
modules/grzegorz.nix
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{config, lib, pkgs, ...}:
|
||||||
|
let
|
||||||
|
grg = config.services.grzegorz;
|
||||||
|
grgw = config.services.grzegorz-webui;
|
||||||
|
in {
|
||||||
|
services.pipewire.enable = true;
|
||||||
|
services.pipewire.alsa.enable = true;
|
||||||
|
services.pipewire.alsa.support32Bit = true;
|
||||||
|
services.pipewire.pulse.enable = true;
|
||||||
|
|
||||||
|
users.users.pvv = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "pvv";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.grzegorz.enable = true;
|
||||||
|
services.grzegorz.listenAddr = "localhost";
|
||||||
|
services.grzegorz.listenPort = 31337;
|
||||||
|
|
||||||
|
services.grzegorz-webui.enable = true;
|
||||||
|
services.grzegorz-webui.listenAddr = "localhost";
|
||||||
|
services.grzegorz-webui.listenPort = 42069;
|
||||||
|
services.grzegorz-webui.listenWebsocketPort = 42042;
|
||||||
|
services.grzegorz-webui.hostName = "${config.networking.fqdn}";
|
||||||
|
services.grzegorz-webui.apiBase = "http://${toString grg.listenAddr}:${toString grg.listenPort}/api";
|
||||||
|
|
||||||
|
security.acme.acceptTerms = true;
|
||||||
|
security.acme.defaults.email = "pederbs@pvv.ntnu.no";
|
||||||
|
|
||||||
|
services.nginx.enable = true;
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."${config.networking.fqdn}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
serverAliases = [
|
||||||
|
"${config.networking.hostName}.pvv.org"
|
||||||
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
allow 129.241.210.128/25;
|
||||||
|
allow 2001:700:300:1900::/64;
|
||||||
|
deny all;
|
||||||
|
'';
|
||||||
|
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz-webui.listenPort}";
|
||||||
|
};
|
||||||
|
# https://github.com/rawpython/remi/issues/216
|
||||||
|
locations."/websocket" = {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz-webui.listenWebsocketPort}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
locations."/api" = {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz.listenPort}";
|
||||||
|
};
|
||||||
|
locations."/docs" = {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString config.services.grzegorz.listenPort}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@@ -1,43 +0,0 @@
|
|||||||
{ callPackage, writeTextFile, writeShellScriptBin, minecraft-server, jre_headless }:
|
|
||||||
|
|
||||||
let
|
|
||||||
loader = callPackage ./generate-loader.nix {};
|
|
||||||
log4j = writeTextFile {
|
|
||||||
name = "log4j.xml";
|
|
||||||
text = ''
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Configuration status="WARN" packages="com.mojang.util">
|
|
||||||
<Appenders>
|
|
||||||
<Console name="SysOut" target="SYSTEM_OUT">
|
|
||||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
|
||||||
</Console>
|
|
||||||
<Queue name="ServerGuiConsole">
|
|
||||||
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
|
|
||||||
</Queue>
|
|
||||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
|
||||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
|
||||||
<Policies>
|
|
||||||
<TimeBasedTriggeringPolicy />
|
|
||||||
<OnStartupTriggeringPolicy />
|
|
||||||
</Policies>
|
|
||||||
<DefaultRolloverStrategy max="1000"/>
|
|
||||||
</RollingRandomAccessFile>
|
|
||||||
</Appenders>
|
|
||||||
<Loggers>
|
|
||||||
<Root level="info">
|
|
||||||
<filters>
|
|
||||||
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
|
|
||||||
</filters>
|
|
||||||
<AppenderRef ref="SysOut"/>
|
|
||||||
<AppenderRef ref="File"/>
|
|
||||||
<AppenderRef ref="ServerGuiConsole"/>
|
|
||||||
</Root>
|
|
||||||
</Loggers>
|
|
||||||
</Configuration>
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in
|
|
||||||
writeShellScriptBin "minecraft-server" ''
|
|
||||||
echo "serverJar=${minecraft-server}/lib/minecraft/server.jar" >> fabric-server-launcher.properties
|
|
||||||
exec ${jre_headless}/bin/java -Dlog4j.configurationFile=${log4j} $@ -jar ${loader} nogui
|
|
||||||
''
|
|
@@ -1,38 +0,0 @@
|
|||||||
{ lib, fetchurl, stdenv, unzip, zip, jre_headless }:
|
|
||||||
|
|
||||||
let
|
|
||||||
lock = import ./lock.nix;
|
|
||||||
libraries = lib.forEach lock.libraries fetchurl;
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "fabric-server-launch.jar";
|
|
||||||
nativeBuildInputs = [ unzip zip jre_headless ];
|
|
||||||
|
|
||||||
libraries = libraries;
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
for i in $libraries; do
|
|
||||||
unzip -o $i
|
|
||||||
done
|
|
||||||
|
|
||||||
cat > META-INF/MANIFEST.MF << EOF
|
|
||||||
Manifest-Version: 1.0
|
|
||||||
Main-Class: net.fabricmc.loader.impl.launch.server.FabricServerLauncher
|
|
||||||
Name: org/objectweb/asm/
|
|
||||||
Implementation-Version: 9.2
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat > fabric-server-launch.properties << EOF
|
|
||||||
launch.mainClass=net.fabricmc.loader.impl.launch.knot.KnotServer
|
|
||||||
EOF
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
jar cmvf META-INF/MANIFEST.MF "server.jar" .
|
|
||||||
zip -d server.jar 'META-INF/*.SF' 'META-INF/*.RSA' 'META-INF/*.DSA'
|
|
||||||
cp server.jar "$out"
|
|
||||||
'';
|
|
||||||
|
|
||||||
phases = [ "buildPhase" "installPhase" ];
|
|
||||||
}
|
|
||||||
|
|
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env nix-shell
|
|
||||||
#!nix-shell -i bash -p bash curl jq
|
|
||||||
curl https://meta.fabricmc.net/v2/versions/loader/1.18.1/0.12.12/server/json \
|
|
||||||
| jq -r '
|
|
||||||
.mainClass,
|
|
||||||
(.libraries[]
|
|
||||||
| .url as $url
|
|
||||||
| .name | split(":") as [$dir, $name, $version]
|
|
||||||
|"\($name)-\($version).zip|\($url)\($dir|sub("\\.";"/";"g"))/\($name)/\($version)/\($name)-\($version).jar"
|
|
||||||
)' \
|
|
||||||
| {
|
|
||||||
echo '{'
|
|
||||||
read mainClass;
|
|
||||||
echo " mainClass = \"$mainClass\";"
|
|
||||||
echo " libraries = ["
|
|
||||||
while IFS="|" read name url; do
|
|
||||||
hash=$(nix-prefetch-url $url);
|
|
||||||
echo " { name = \"$name\"; sha256 = \"$hash\"; url = \"$url\"; }"
|
|
||||||
done
|
|
||||||
echo " ];"
|
|
||||||
echo '}'
|
|
||||||
}
|
|
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
mainClass = "net.fabricmc.loader.impl.launch.knot.KnotServer";
|
|
||||||
libraries = [
|
|
||||||
{ name = "tiny-mappings-parser-0.3.0+build.17.zip"; sha256 = "19kvhxfk5v01f2rvl7j02vqhn3nd2bh5jsgbk44rpzqv9f6074db"; url = "https://maven.fabricmc.net/net/fabricmc/tiny-mappings-parser/0.3.0+build.17/tiny-mappings-parser-0.3.0+build.17.jar"; }
|
|
||||||
{ name = "sponge-mixin-0.10.7+mixin.0.8.4.zip"; sha256 = "18m5wksd9vjp676cxapkggnz8s3f8j89phln8gy5n8vxlrli8n0d"; url = "https://maven.fabricmc.net/net/fabricmc/sponge-mixin/0.10.7+mixin.0.8.4/sponge-mixin-0.10.7+mixin.0.8.4.jar"; }
|
|
||||||
{ name = "tiny-remapper-0.6.0.zip"; sha256 = "1ynjfxg7cj9rd9c4l450w7yp20p2csjdpnk3mcx5bdkjzhbgvgzf"; url = "https://maven.fabricmc.net/net/fabricmc/tiny-remapper/0.6.0/tiny-remapper-0.6.0.jar"; }
|
|
||||||
{ name = "access-widener-2.0.1.zip"; sha256 = "0a7s4x6dbaa9p59ps7pidzwrs0xwy5i17s35xrgh58i26szlsaxm"; url = "https://maven.fabricmc.net/net/fabricmc/access-widener/2.0.1/access-widener-2.0.1.jar"; }
|
|
||||||
{ name = "asm-9.2.zip"; sha256 = "1xa7kccwmcqcdw1xly6n2frzhk56m8ma9v7h764g73ckf56zxm5r"; url = "https://maven.fabricmc.net/org/ow2/asm/asm/9.2/asm-9.2.jar"; }
|
|
||||||
{ name = "asm-analysis-9.2.zip"; sha256 = "1i1kyirizs5sm2v0f06sdz86mbmyn61vjr9d9p8p5h1i2x9bx3w7"; url = "https://maven.fabricmc.net/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar"; }
|
|
||||||
{ name = "asm-commons-9.2.zip"; sha256 = "19p04mr14ahndba65v4krbvf4p5syf8wz0fp5i9bnf5270qyak5y"; url = "https://maven.fabricmc.net/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar"; }
|
|
||||||
{ name = "asm-tree-9.2.zip"; sha256 = "04g0zb7v65iz4k2m2grdpbv8jjryrzkkw7ww23yfp94i6399pgxa"; url = "https://maven.fabricmc.net/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar"; }
|
|
||||||
{ name = "asm-util-9.2.zip"; sha256 = "16759v4hh3ijpf4cglrxybz29x2hiylhsa388y09m2mf679kqnzz"; url = "https://maven.fabricmc.net/org/ow2/asm/asm-util/9.2/asm-util-9.2.jar"; }
|
|
||||||
{ name = "intermediary-1.18.1.zip"; sha256 = "1rfz2gazvnivn6hlqiyjpiaycz8va87n5czy1p6w3lnrlfggj2i9"; url = "https://maven.fabricmc.net/net/fabricmc/intermediary/1.18.1/intermediary-1.18.1.jar"; }
|
|
||||||
{ name = "fabric-loader-0.12.12.zip"; sha256 = "070dpcp7kcj4xr75wp1j6pb1bgfzllwg8xmqk3sk79jfqiqwzizw"; url = "https://maven.fabricmc.net/net/fabricmc/fabric-loader/0.12.12/fabric-loader-0.12.12.jar"; }
|
|
||||||
];
|
|
||||||
}
|
|
@@ -1,38 +0,0 @@
|
|||||||
{ lib, stdenv, fetchurl, nixosTests, jre_headless }:
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "minecraft-server";
|
|
||||||
version = "1.18.1";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://launcher.mojang.com/v1/objects/125e5adf40c659fd3bce3e66e67a16bb49ecc1b9/server.jar";
|
|
||||||
# sha1 because that comes from mojang via api
|
|
||||||
sha1 = "125e5adf40c659fd3bce3e66e67a16bb49ecc1b9";
|
|
||||||
};
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin $out/lib/minecraft
|
|
||||||
cp -v $src $out/lib/minecraft/server.jar
|
|
||||||
cat > $out/bin/minecraft-server << EOF
|
|
||||||
#!/bin/sh
|
|
||||||
exec ${jre_headless}/bin/java \$@ -jar $out/lib/minecraft/server.jar nogui
|
|
||||||
EOF
|
|
||||||
chmod +x $out/bin/minecraft-server
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
tests = { inherit (nixosTests) minecraft-server; };
|
|
||||||
updateScript = ./update.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Minecraft Server";
|
|
||||||
homepage = "https://minecraft.net";
|
|
||||||
license = licenses.unfreeRedistributable;
|
|
||||||
platforms = platforms.unix;
|
|
||||||
maintainers = with maintainers; [ thoughtpolice tomberek costrouc ];
|
|
||||||
};
|
|
||||||
}
|
|
20
users/adriangl.nix
Normal file
20
users/adriangl.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
users.users.adriangl = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "(0_0)";
|
||||||
|
extraGroups = [
|
||||||
|
"wheel"
|
||||||
|
"drift"
|
||||||
|
];
|
||||||
|
|
||||||
|
packages = with pkgs; [
|
||||||
|
exa
|
||||||
|
neovim
|
||||||
|
];
|
||||||
|
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFa5y7KyLn2tjxed1czMbyM5scnEpo9v/GfnhL/28ckM legolas"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
10
values.nix
10
values.nix
@@ -4,7 +4,7 @@ let
|
|||||||
pvv-ipv6 = suffix: "2001:700:300:1900::${toString suffix}";
|
pvv-ipv6 = suffix: "2001:700:300:1900::${toString suffix}";
|
||||||
in rec {
|
in rec {
|
||||||
ipv4-space = pvv-ipv4 "128/25";
|
ipv4-space = pvv-ipv4 "128/25";
|
||||||
ipv6-space = pvv-ipv4 "/64";
|
ipv6-space = pvv-ipv6 "/64";
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
matrix = {
|
matrix = {
|
||||||
@@ -41,6 +41,14 @@ in rec {
|
|||||||
ipv4 = pvv-ipv4 196;
|
ipv4 = pvv-ipv4 196;
|
||||||
ipv6 = pvv-ipv6 196;
|
ipv6 = pvv-ipv6 196;
|
||||||
};
|
};
|
||||||
|
brzeczyszczykiewicz = {
|
||||||
|
ipv4 = pvv-ipv4 205;
|
||||||
|
ipv6 = pvv-ipv6 "1:50"; # Wtf peder why
|
||||||
|
};
|
||||||
|
georg = {
|
||||||
|
ipv4 = pvv-ipv4 204;
|
||||||
|
ipv6 = pvv-ipv6 "1:4f"; # Wtf øystein og daniel why
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultNetworkConfig = {
|
defaultNetworkConfig = {
|
||||||
|
Reference in New Issue
Block a user