mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-01-13 10:58:24 +01:00
Compare commits
14 Commits
gitea-show
...
d59a3f6ec0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d59a3f6ec0 | ||
|
|
b730bdc34d | ||
|
|
f1f4da9ff6 | ||
|
|
cd40bd6178 | ||
|
|
41e7f09c8b | ||
|
|
30bedecd72 | ||
|
|
29ad65bfef | ||
|
|
b5a95eac90 | ||
|
|
b2adb38a8b | ||
|
|
3a707b00d3 | ||
| c83005983e | |||
|
|
4f28815018 | ||
|
|
bdaa765dbb | ||
| c0e551eb8b |
@@ -50,6 +50,18 @@
|
|||||||
kitty.terminfo
|
kitty.terminfo
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# .bash_profile already works, but lets also use .bashrc like literally every other distro
|
||||||
|
# https://man.archlinux.org/man/core/bash/bash.1.en#INVOCATION
|
||||||
|
# home-manager usually handles this for you: https://github.com/nix-community/home-manager/blob/22a36aa709de7dd42b562a433b9cefecf104a6ee/modules/programs/bash.nix#L203-L209
|
||||||
|
# btw, programs.bash.shellInit just goes into environment.shellInit which in turn goes into /etc/profile, spooky shit
|
||||||
|
programs.bash.shellInit = ''
|
||||||
|
if [ -n "''${BASH_VERSION:-}" ]; then
|
||||||
|
if [[ ! -f ~/.bash_profile && ! -f ~/.bash_login ]]; then
|
||||||
|
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
security.lockKernelModules = true;
|
security.lockKernelModules = true;
|
||||||
|
|||||||
4
flake.lock
generated
4
flake.lock
generated
@@ -130,11 +130,11 @@
|
|||||||
"rev": "e4dafd06b3d7e9e6e07617766e9c3743134571b7",
|
"rev": "e4dafd06b3d7e9e6e07617766e9c3743134571b7",
|
||||||
"revCount": 7,
|
"revCount": 7,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git"
|
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git"
|
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
|||||||
17
flake.nix
17
flake.nix
@@ -20,7 +20,7 @@
|
|||||||
matrix-next.url = "github:dali99/nixos-matrix-modules/0.7.0";
|
matrix-next.url = "github:dali99/nixos-matrix-modules/0.7.0";
|
||||||
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
|
matrix-next.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
nix-gitea-themes.url = "git+https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git";
|
nix-gitea-themes.url = "git+https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git";
|
||||||
nix-gitea-themes.inputs.nixpkgs.follows = "nixpkgs";
|
nix-gitea-themes.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
greg-ng.url = "git+https://git.pvv.ntnu.no/Grzegorz/greg-ng.git";
|
greg-ng.url = "git+https://git.pvv.ntnu.no/Grzegorz/greg-ng.git";
|
||||||
@@ -71,6 +71,11 @@
|
|||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg)
|
||||||
|
[
|
||||||
|
"nvidia-x11"
|
||||||
|
"nvidia-settings"
|
||||||
|
];
|
||||||
overlays = [
|
overlays = [
|
||||||
# Global overlays go here
|
# Global overlays go here
|
||||||
] ++ config.overlays or [ ];
|
] ++ config.overlays or [ ];
|
||||||
@@ -114,6 +119,7 @@
|
|||||||
ildkule = stableNixosConfig "ildkule" { };
|
ildkule = stableNixosConfig "ildkule" { };
|
||||||
#ildkule-unstable = unstableNixosConfig "ildkule" { };
|
#ildkule-unstable = unstableNixosConfig "ildkule" { };
|
||||||
shark = stableNixosConfig "shark" { };
|
shark = stableNixosConfig "shark" { };
|
||||||
|
wenche = stableNixosConfig "wenche" { };
|
||||||
|
|
||||||
kommode = stableNixosConfig "kommode" {
|
kommode = stableNixosConfig "kommode" {
|
||||||
overlays = [
|
overlays = [
|
||||||
@@ -162,6 +168,15 @@
|
|||||||
|
|
||||||
devShells = forAllSystems (system: {
|
devShells = forAllSystems (system: {
|
||||||
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
||||||
|
cuda = let
|
||||||
|
cuda-pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
cudaSupport = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in cuda-pkgs.callPackage ./shells/cuda.nix { };
|
||||||
});
|
});
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
|
|||||||
@@ -67,7 +67,12 @@ in {
|
|||||||
ADMIN_NAME = "PVV Drift";
|
ADMIN_NAME = "PVV Drift";
|
||||||
ADMIN_EMAIL = "drift@pvv.ntnu.no";
|
ADMIN_EMAIL = "drift@pvv.ntnu.no";
|
||||||
ADMIN_PASSWORD = includeFromSops "simplesamlphp/admin_password";
|
ADMIN_PASSWORD = includeFromSops "simplesamlphp/admin_password";
|
||||||
TRUSTED_DOMAINS = [ cfg.domainName ];
|
TRUSTED_DOMAINS = [
|
||||||
|
"www.pvv.ntnu.no"
|
||||||
|
"pvv.ntnu.no"
|
||||||
|
"www.pvv.org"
|
||||||
|
"pvv.org"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,10 +7,9 @@
|
|||||||
(fp /misc/metrics-exporters.nix)
|
(fp /misc/metrics-exporters.nix)
|
||||||
./services/nginx
|
./services/nginx
|
||||||
|
|
||||||
|
./services/calendar-bot.nix
|
||||||
./services/mysql.nix
|
./services/mysql.nix
|
||||||
./services/postgres.nix
|
./services/postgres.nix
|
||||||
./services/mysql.nix
|
|
||||||
./services/calendar-bot.nix
|
|
||||||
|
|
||||||
./services/matrix
|
./services/matrix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ in {
|
|||||||
START_LFS_SERVER = true;
|
START_LFS_SERVER = true;
|
||||||
LANDING_PAGE = "explore";
|
LANDING_PAGE = "explore";
|
||||||
};
|
};
|
||||||
|
"git.timeout" = {
|
||||||
|
MIGRATE = 3600;
|
||||||
|
MIRROR = 1800;
|
||||||
|
};
|
||||||
mailer = {
|
mailer = {
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
FROM = "gitea@pvv.ntnu.no";
|
FROM = "gitea@pvv.ntnu.no";
|
||||||
@@ -136,6 +140,7 @@ in {
|
|||||||
|
|
||||||
dump = {
|
dump = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
interval = "weekly";
|
||||||
type = "tar.gz";
|
type = "tar.gz";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
39
hosts/wenche/configuration.nix
Normal file
39
hosts/wenche/configuration.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{ config, fp, pkgs, values, lib, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Include the results of the hardware scan.
|
||||||
|
./hardware-configuration.nix
|
||||||
|
(fp /base)
|
||||||
|
(fp /misc/metrics-exporters.nix)
|
||||||
|
|
||||||
|
(fp /misc/builder.nix)
|
||||||
|
];
|
||||||
|
|
||||||
|
sops.defaultSopsFile = fp /secrets/wenche/wenche.yaml;
|
||||||
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
|
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
||||||
|
sops.age.generateKey = true;
|
||||||
|
|
||||||
|
boot.loader.grub.device = "/dev/sda";
|
||||||
|
|
||||||
|
networking.hostName = "wenche"; # Define your hostname.
|
||||||
|
|
||||||
|
systemd.network.networks."30-ens18" = values.defaultNetworkConfig // {
|
||||||
|
matchConfig.Name = "ens18";
|
||||||
|
address = with values.hosts.wenche; [ (ipv4 + "/25") (ipv6 + "/64") ];
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.graphics.enable = true;
|
||||||
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
|
hardware.nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
open = false;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.production;
|
||||||
|
};
|
||||||
|
|
||||||
|
# List packages installed in system profile
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
}
|
||||||
27
hosts/wenche/hardware-configuration.nix
Normal file
27
hosts/wenche/hardware-configuration.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "nvidia" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/4e8ecdd2-d453-4fff-b952-f06da00f3b85";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ {
|
||||||
|
device = "/var/lib/swapfile";
|
||||||
|
size = 16*1024;
|
||||||
|
} ];
|
||||||
|
|
||||||
|
networking.useDHCP = lib.mkDefault false;
|
||||||
|
# networking.interfaces.ens18.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
}
|
||||||
45
shells/cuda.nix
Normal file
45
shells/cuda.nix
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# nix develop .#cuda
|
||||||
|
# Copied from https://nixos.wiki/wiki/CUDA
|
||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
pkgs.mkShell {
|
||||||
|
name = "cuda-env-shell";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
autoconf
|
||||||
|
binutils
|
||||||
|
curl
|
||||||
|
freeglut
|
||||||
|
git
|
||||||
|
gitRepo
|
||||||
|
gnumake
|
||||||
|
gnupg
|
||||||
|
gperf
|
||||||
|
libGL
|
||||||
|
libGLU
|
||||||
|
m4
|
||||||
|
ncurses5
|
||||||
|
procps
|
||||||
|
stdenv.cc
|
||||||
|
unzip
|
||||||
|
util-linux
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXext
|
||||||
|
xorg.libXi
|
||||||
|
xorg.libXmu
|
||||||
|
xorg.libXrandr
|
||||||
|
xorg.libXv
|
||||||
|
zlib
|
||||||
|
|
||||||
|
cudatoolkit
|
||||||
|
linuxPackages.nvidia_x11
|
||||||
|
|
||||||
|
# Other applications, like
|
||||||
|
hashcat
|
||||||
|
];
|
||||||
|
|
||||||
|
env = {
|
||||||
|
CUDA_PATH = pkgs.cudatoolkit;
|
||||||
|
EXTRA_LDFLAGS = "-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib";
|
||||||
|
EXTRA_CCFLAGS = "-I/usr/include";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -68,6 +68,10 @@ in rec {
|
|||||||
ipv4 = pvv-ipv4 234;
|
ipv4 = pvv-ipv4 234;
|
||||||
ipv6 = pvv-ipv6 234;
|
ipv6 = pvv-ipv6 234;
|
||||||
};
|
};
|
||||||
|
wenche = {
|
||||||
|
ipv4 = pvv-ipv4 240;
|
||||||
|
ipv6 = pvv-ipv6 240;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultNetworkConfig = {
|
defaultNetworkConfig = {
|
||||||
|
|||||||
Reference in New Issue
Block a user