mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-01-13 02:48:24 +01:00
Compare commits
1 Commits
e928a5e981
...
gitea-show
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11855f4c5f |
@@ -50,18 +50,6 @@
|
|||||||
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/Drift/nix-gitea-themes.git"
|
"url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.pvv.ntnu.no/Drift/nix-gitea-themes.git"
|
"url": "https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
|||||||
19
flake.nix
19
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/Drift/nix-gitea-themes.git";
|
nix-gitea-themes.url = "git+https://git.pvv.ntnu.no/oysteikt/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,11 +71,6 @@
|
|||||||
|
|
||||||
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 [ ];
|
||||||
@@ -91,7 +86,6 @@
|
|||||||
modules = [
|
modules = [
|
||||||
inputs.matrix-next.nixosModules.default
|
inputs.matrix-next.nixosModules.default
|
||||||
inputs.pvv-calendar-bot.nixosModules.default
|
inputs.pvv-calendar-bot.nixosModules.default
|
||||||
self.nixosModules.gickup
|
|
||||||
];
|
];
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.pvv-calendar-bot.overlays.x86_64-linux.default
|
inputs.pvv-calendar-bot.overlays.x86_64-linux.default
|
||||||
@@ -120,7 +114,6 @@
|
|||||||
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 = [
|
||||||
@@ -165,20 +158,10 @@
|
|||||||
snakeoil-certs = ./modules/snakeoil-certs.nix;
|
snakeoil-certs = ./modules/snakeoil-certs.nix;
|
||||||
snappymail = ./modules/snappymail.nix;
|
snappymail = ./modules/snappymail.nix;
|
||||||
robots-txt = ./modules/robots-txt.nix;
|
robots-txt = ./modules/robots-txt.nix;
|
||||||
gickup = ./modules/gickup.nix;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
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,12 +67,7 @@ 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 = [
|
TRUSTED_DOMAINS = [ cfg.domainName ];
|
||||||
"www.pvv.ntnu.no"
|
|
||||||
"pvv.ntnu.no"
|
|
||||||
"www.pvv.org"
|
|
||||||
"pvv.org"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
(fp /misc/metrics-exporters.nix)
|
(fp /misc/metrics-exporters.nix)
|
||||||
./services/nginx
|
./services/nginx
|
||||||
|
|
||||||
./services/calendar-bot.nix
|
|
||||||
./services/git-mirrors
|
|
||||||
./services/mysql.nix
|
./services/mysql.nix
|
||||||
./services/postgres.nix
|
./services/postgres.nix
|
||||||
|
./services/mysql.nix
|
||||||
|
./services/calendar-bot.nix
|
||||||
|
|
||||||
./services/matrix
|
./services/matrix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
services.gickup = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
source = {
|
|
||||||
github = [{
|
|
||||||
# token_file = sops
|
|
||||||
include = [
|
|
||||||
"go-gitea/gitea"
|
|
||||||
"unmojang/FjordLauncher"
|
|
||||||
"unmojang/drasl"
|
|
||||||
"NixOS/nixpkgs"
|
|
||||||
"saltstack/salt"
|
|
||||||
"heimdal/heimdal"
|
|
||||||
"yushijinhun/authlib-injector"
|
|
||||||
"Git-Mediawiki/Git-Mediawiki"
|
|
||||||
];
|
|
||||||
wiki = true;
|
|
||||||
issues = true;
|
|
||||||
}];
|
|
||||||
gitlab = [{
|
|
||||||
include = [
|
|
||||||
"mx-puppet/discord/better-discord.js"
|
|
||||||
"mx-puppet/discord/matrix-discord-parser"
|
|
||||||
"mx-puppet/discord/discord-markdown"
|
|
||||||
"mx-puppet/discord/mx-puppet-discord"
|
|
||||||
"mx-puppet/mx-puppet-bridge"
|
|
||||||
];
|
|
||||||
}];
|
|
||||||
any = [
|
|
||||||
{
|
|
||||||
url = "https://sourceware.org/git/glibc.git";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
destination.local = [{
|
|
||||||
path = "/data/git-mirrors";
|
|
||||||
structured = true;
|
|
||||||
zip = true;
|
|
||||||
keep = 5;
|
|
||||||
bare = true;
|
|
||||||
lfs = true;
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -38,6 +38,10 @@ in
|
|||||||
# Bigger icons
|
# Bigger icons
|
||||||
install -Dm444 "${cfg.package.src}/templates/repo/icon.tmpl" "$out/repo/icon.tmpl"
|
install -Dm444 "${cfg.package.src}/templates/repo/icon.tmpl" "$out/repo/icon.tmpl"
|
||||||
sed -i -e 's/24/48/g' "$out/repo/icon.tmpl"
|
sed -i -e 's/24/48/g' "$out/repo/icon.tmpl"
|
||||||
|
|
||||||
|
# Show license in list view
|
||||||
|
patch -i ${./licenses-in-repo-list.diff} "${cfg.package.src}/templates/explore/repo_list.tmpl" -o repo_list.tmpl
|
||||||
|
install -Dm444 repo_list.tmpl "$out/explore/repo_list.tmpl"
|
||||||
'';
|
'';
|
||||||
in ''
|
in ''
|
||||||
install -Dm444 ${logo-svg} ${cfg.customDir}/public/assets/img/logo.svg
|
install -Dm444 ${logo-svg} ${cfg.customDir}/public/assets/img/logo.svg
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
33a34,38
|
||||||
|
> {{if .DetectedRepoLicenses}}
|
||||||
|
> <a class="flex-text-inline" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
|
||||||
|
> {{svg "octicon-law"}} {{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
|
||||||
|
> </a>
|
||||||
|
> {{end}}
|
||||||
@@ -49,10 +49,6 @@ 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";
|
||||||
@@ -140,7 +136,6 @@ in {
|
|||||||
|
|
||||||
dump = {
|
dump = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interval = "weekly";
|
|
||||||
type = "tar.gz";
|
type = "tar.gz";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
{ 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?
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
{ 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";
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.services.gickup;
|
|
||||||
format = pkgs.formats.yaml { };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.services.gickup = {
|
|
||||||
enable = lib.mkEnableOption "gickup, a git repository mirroring service";
|
|
||||||
package = lib.mkPackageOption pkgs "gickup" { };
|
|
||||||
|
|
||||||
gitPackage = lib.mkPackageOption pkgs "git" { };
|
|
||||||
gitLfsPackage = lib.mkPackageOption pkgs "git-lfs" { };
|
|
||||||
|
|
||||||
settings = lib.mkOption {
|
|
||||||
type = lib.types.submodule {
|
|
||||||
freeformType = format.type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
users.users.gickup = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "gickup";
|
|
||||||
home = "/var/lib/gickup";
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.gickup = { };
|
|
||||||
|
|
||||||
systemd.services.gickup = {
|
|
||||||
description = "Gickup git repository mirroring service";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
after = [ "network.target" ];
|
|
||||||
|
|
||||||
path = [
|
|
||||||
cfg.gitPackage
|
|
||||||
cfg.gitLfsPackage
|
|
||||||
];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = utils.escapeSystemdExecArgs [
|
|
||||||
(lib.getExe cfg.package)
|
|
||||||
(format.generate "gickup-settings.conf" cfg.settings)
|
|
||||||
];
|
|
||||||
|
|
||||||
StateDirectory = "gickup";
|
|
||||||
WorkingDirectory = "gickup";
|
|
||||||
RuntimeDirectory = "gickup";
|
|
||||||
RuntimeDirectoryMode = "0700";
|
|
||||||
|
|
||||||
# Hardening options
|
|
||||||
AmbientCapabilities = [];
|
|
||||||
LockPersonality = true;
|
|
||||||
NoNewPrivileges = true;
|
|
||||||
PrivateDevices = true;
|
|
||||||
PrivateMounts = true;
|
|
||||||
PrivateTmp = true;
|
|
||||||
PrivateUsers = true;
|
|
||||||
ProcSubset = "pid";
|
|
||||||
ProtectClock = true;
|
|
||||||
ProtectControlGroups = true;
|
|
||||||
ProtectHome = true;
|
|
||||||
ProtectHostname = true;
|
|
||||||
ProtectKernelLogs = true;
|
|
||||||
ProtectKernelModules = true;
|
|
||||||
ProtectKernelTunables = true;
|
|
||||||
ProtectProc = "invisible";
|
|
||||||
ProtectSystem = "strict";
|
|
||||||
RemoveIPC = true;
|
|
||||||
RestrictAddressFamilies = [
|
|
||||||
"AF_INET"
|
|
||||||
"AF_INET6"
|
|
||||||
];
|
|
||||||
RestrictNamespaces = true;
|
|
||||||
RestrictRealtime = true;
|
|
||||||
RestrictSUIDSGID = true;
|
|
||||||
SystemCallArchitectures = "native";
|
|
||||||
SystemCallFilter = [
|
|
||||||
"@system-service"
|
|
||||||
"~@resources"
|
|
||||||
"~@privileged"
|
|
||||||
];
|
|
||||||
UMask = "0002";
|
|
||||||
CapabilityBoundingSet = [];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# 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,10 +68,6 @@ 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