Compare commits
76 Commits
test-deplo
...
f894f65024
| Author | SHA1 | Date | |
|---|---|---|---|
| f894f65024 | |||
| 7468ccd09f | |||
| c2f8b28b5d | |||
| ff52a9c024 | |||
|
|
2389cfb703 | ||
|
|
ab408f5eed | ||
|
|
37b5d11b75 | ||
| d83ecd19dd | |||
| 92ab3eb6d6 | |||
| 92b6f03db1 | |||
| fa6bd362c8 | |||
| ccf9e6b624 | |||
|
|
eaf515e178 | ||
|
|
2a73531342 | ||
| 637433e101 | |||
| 7173c81006 | |||
| b5c6c781c1 | |||
| fd20c8ff2d | |||
| 5c1dec5c27 | |||
| a194e1fb90 | |||
| 9a20f7846e | |||
| 5affde5fff | |||
| cf7bbca114 | |||
| 85aab484cf | |||
| 07926b877a | |||
| 01be899805 | |||
| 2d2ade7d45 | |||
| ef4344b962 | |||
| 4c1d0b06dc | |||
| daa7881658 | |||
| 5573970ac0 | |||
| 4278477cc9 | |||
| e60f7c9fc4 | |||
| 05d545d7a6 | |||
| 6bbcfe69e1 | |||
| 1158a8b5ef | |||
| 1704340180 | |||
| 8dd68054fa | |||
| 9bb345c061 | |||
| 228ac9214c | |||
| 84a5a8090d | |||
| de7dbd91b4 | |||
| 56ffeaf5a0 | |||
| 13b08066ce | |||
| 681ddb80f7 | |||
| 76b2b92840 | |||
| a6183e7d41 | |||
| 9f14c96f86 | |||
| f787cca05c | |||
| c2e99ff5ae | |||
| 263851f911 | |||
| bcab85f731 | |||
| 29b632a961 | |||
|
|
d068ea8c2d | ||
|
|
54443f177b | ||
|
|
c1470a7312 | ||
|
|
0032d65e18 | ||
|
|
45300e7a21 | ||
|
|
009dc9373f | ||
|
|
273066c74a | ||
|
|
d4b315e90e | ||
|
|
527a17a169 | ||
|
|
77b1bf9249 | ||
|
|
1e58fbe5f4 | ||
|
|
f06e325736 | ||
|
|
8ee5550803 | ||
|
|
db23c300fe | ||
|
|
24954e5367 | ||
|
|
1a80911b3f | ||
|
|
ddf12655bc | ||
|
|
e5207d10ab | ||
|
|
2f4c425c50 | ||
|
|
70d25c574d | ||
|
|
9a9cc67b1c | ||
|
|
0266841088 | ||
| 7bdb31c46c |
@@ -5,6 +5,9 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
container:
|
||||||
|
volumes:
|
||||||
|
- /nix/store:/var/nix/hosted-store
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
@@ -12,25 +15,23 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- name: setup
|
||||||
- name: Restore and save Nix store
|
env:
|
||||||
uses: nix-community/cache-nix-action@v6
|
CACHE_PRIVKEY: ${{secrets.CACHE_PRIVKEY}}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p /var/secrets/
|
||||||
|
echo "$CACHE_PRIVKEY" >> /var/secrets/cache_privkey
|
||||||
|
mkdir -p /etc/nix
|
||||||
|
cp ./scripts/upload-to-cache.sh /etc/nix/
|
||||||
|
chmod +x /etc/nix/upload-to-cache.sh
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
# restore and save a cache using this key
|
extra_nix_config: |
|
||||||
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
|
extra-trusted-public-keys = localhost:TiRpr2LzamX/MCKBUmFlZ8inWz94QWGL88fMEHg9Kgc=
|
||||||
# if there's no cache hit, restore a cache by this prefix
|
extra-substituters = "local?store=/var/nix/hosted-store&priority=20"
|
||||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
secret-key-files = /var/secrets/cache_privkey
|
||||||
# collect garbage until the Nix store size (in bytes) is at most this number
|
post-build-hook = /etc/nix/upload-to-cache.sh
|
||||||
# before trying to save a new cache
|
|
||||||
# 1G = 1073741824
|
|
||||||
gc-max-store-size-linux: 1G
|
|
||||||
# do purge caches
|
|
||||||
purge: true
|
|
||||||
# purge all versions of the cache
|
|
||||||
purge-prefixes: nix-${{ runner.os }}-
|
|
||||||
# created more than this number of seconds ago
|
|
||||||
purge-created: 60000
|
|
||||||
purge-primary-key: never
|
|
||||||
- name: Install SSH key
|
- name: Install SSH key
|
||||||
uses: shimataro/ssh-key-action@v2
|
uses: shimataro/ssh-key-action@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
30
flake.lock
generated
30
flake.lock
generated
@@ -49,11 +49,11 @@
|
|||||||
"nixpkgs": "nixpkgs_3"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762095388,
|
"lastModified": 1768336726,
|
||||||
"narHash": "sha256-7Q8LtcvKWHbP8znARRTOY2tpU5WoV6FHwp5TZJOI8Us=",
|
"narHash": "sha256-Os4qn0S0bv7MauXGz16ozyOYZuMrA2FJuXNjDnr5yps=",
|
||||||
"owner": "9001",
|
"owner": "9001",
|
||||||
"repo": "copyparty",
|
"repo": "copyparty",
|
||||||
"rev": "ac085b8149ff50e03d260128596dd130ed1c7cae",
|
"rev": "c46cd7f57a8ae3b121866485c91ec078c4dd970e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -91,11 +91,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762276996,
|
"lastModified": 1766150702,
|
||||||
"narHash": "sha256-TtcPgPmp2f0FAnc+DMEw4ardEgv1SGNR3/WFGH0N19M=",
|
"narHash": "sha256-P0kM+5o+DKnB6raXgFEk3azw8Wqg5FL6wyl9jD+G5a4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "af087d076d3860760b3323f6b583f4d828c1ac17",
|
"rev": "916506443ecd0d0b4a0f4cf9d40a3c22ce39b378",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -233,11 +233,11 @@
|
|||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762826586,
|
"lastModified": 1767838769,
|
||||||
"narHash": "sha256-KlPcXOxxyv+KNcf7yNFQ4DGVFbOpITqHfvMcAUYrL7E=",
|
"narHash": "sha256-KCLU6SUU80tEBKIVZsBrSjRYX6kn1eVIYI3fEEqOp24=",
|
||||||
"owner": "Infinidoge",
|
"owner": "Infinidoge",
|
||||||
"repo": "nix-minecraft",
|
"repo": "nix-minecraft",
|
||||||
"rev": "1a4fa22ec6e9f2ece24fca273352463b75f6f7c0",
|
"rev": "4da21f019f6443f513f16af7f220ba4db1cdfc04",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -311,11 +311,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_5": {
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762756533,
|
"lastModified": 1767313136,
|
||||||
"narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=",
|
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d",
|
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -452,11 +452,11 @@
|
|||||||
},
|
},
|
||||||
"unstable": {
|
"unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1762596750,
|
"lastModified": 1768127708,
|
||||||
"narHash": "sha256-rXXuz51Bq7DHBlfIjN7jO8Bu3du5TV+3DSADBX7/9YQ=",
|
"narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b6a8526db03f735b89dd5ff348f53f752e7ddc8e",
|
"rev": "ffbc9f8cbaacfb331b6017d5a5abb21a492c9a38",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
88
flake.nix
88
flake.nix
@@ -18,15 +18,14 @@
|
|||||||
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
|
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
|
||||||
testing-grounds.url = "gitlab:shobu13/testing-grounds";
|
testing-grounds.url = "gitlab:shobu13/testing-grounds";
|
||||||
shoblog-front.url = "gitlab:shobu13/shoblog";
|
shoblog-front.url = "gitlab:shobu13/shoblog";
|
||||||
# striped-front.url = "git+ssh://git@gitlab.com/striped1/striped-front";
|
|
||||||
# striped-back.url = "git+ssh://git@gitlab.com/striped1/striped-back";
|
|
||||||
|
|
||||||
copyparty.url = "github:9001/copyparty";
|
copyparty.url = "github:9001/copyparty";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Flake outputs
|
# Flake outputs
|
||||||
outputs = inputs@{
|
outputs =
|
||||||
|
inputs@{
|
||||||
self,
|
self,
|
||||||
|
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
@@ -52,11 +51,36 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
# Helper to provide system-specific attributes
|
# Helper to provide system-specific attributes
|
||||||
forEachSupportedSystem = f: inputs.nixpkgs.lib.genAttrs supportedSystems (system: f {
|
forEachSupportedSystem =
|
||||||
|
f:
|
||||||
|
inputs.nixpkgs.lib.genAttrs supportedSystems (
|
||||||
|
system:
|
||||||
|
f {
|
||||||
pkgs = import inputs.nixpkgs { inherit system; };
|
pkgs = import inputs.nixpkgs { inherit system; };
|
||||||
});
|
}
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
nixosConfigurations = {
|
||||||
|
sin = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
disko.nixosModules.disko
|
||||||
|
agenix.nixosModules.default
|
||||||
|
./hosts/sin/configuration.nix
|
||||||
|
./hosts/sin/hardware-configuration.nix
|
||||||
|
]
|
||||||
|
++ [
|
||||||
|
# modules
|
||||||
|
./modules/gitea/sin
|
||||||
|
];
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit inputs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
colmenaHive = colmena.lib.makeHive {
|
colmenaHive = colmena.lib.makeHive {
|
||||||
meta = {
|
meta = {
|
||||||
nixpkgs = import nixpkgs {
|
nixpkgs = import nixpkgs {
|
||||||
@@ -69,11 +93,20 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
thea = {name, nodes, pkgs, ...}: {
|
thea =
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
nodes,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
agenix.nixosModules.default
|
||||||
./hosts/${name}/configuration.nix
|
./hosts/${name}/configuration.nix
|
||||||
./hosts/${name}/hardware-configuration.nix
|
./hosts/${name}/hardware-configuration.nix
|
||||||
] ++ [
|
]
|
||||||
|
++ [
|
||||||
# modules
|
# modules
|
||||||
./modules/gitea/${name}
|
./modules/gitea/${name}
|
||||||
];
|
];
|
||||||
@@ -81,37 +114,54 @@
|
|||||||
deployment.targetHost = "192.168.1.12";
|
deployment.targetHost = "192.168.1.12";
|
||||||
};
|
};
|
||||||
|
|
||||||
sin = {name, nodes, pkgs, ...}: {
|
sin =
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
nodes,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
disko.nixosModules.disko
|
disko.nixosModules.disko
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
./hosts/${name}/configuration.nix
|
./hosts/${name}/configuration.nix
|
||||||
./hosts/${name}/hardware-configuration.nix
|
./hosts/${name}/hardware-configuration.nix
|
||||||
] ++ [
|
]
|
||||||
|
++ [
|
||||||
# modules
|
# modules
|
||||||
./modules/gitea/${name}
|
./modules/gitea/${name}
|
||||||
];
|
];
|
||||||
|
|
||||||
deployment.targetHost = "192.168.1.14";
|
deployment.targetHost = "192.168.1.14";
|
||||||
|
deployment.allowLocalDeployment = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
devShells = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
# The Nix packages provided in the environment
|
# The Nix packages provided in the environment
|
||||||
# Add any you need here
|
# Add any you need here
|
||||||
packages = with pkgs; [ colmena.packages.${pkgs.system}.colmena ];
|
packages = with pkgs; [
|
||||||
|
colmena.packages.${pkgs.stdenv.system}.colmena
|
||||||
|
agenix.packages.${pkgs.stdenv.system}.agenix
|
||||||
|
];
|
||||||
|
|
||||||
# Set any environment variables for your dev shell
|
# Set any environment variables for your dev shell
|
||||||
env = { };
|
env = { };
|
||||||
|
|
||||||
# Add any shell logic you want executed any time the environment is activated
|
# Add any shell logic you want executed any time the environment is activated
|
||||||
shellHook = ''
|
shellHook = '''';
|
||||||
'';
|
};
|
||||||
};
|
}
|
||||||
});
|
);
|
||||||
|
|
||||||
packages = forEachSupportedSystem ({pkgs}: {
|
packages = forEachSupportedSystem (
|
||||||
inherit (colmena.packages."${pkgs.system}") colmena;
|
{ pkgs }:
|
||||||
});
|
{
|
||||||
|
inherit (colmena.packages."${pkgs.system}") colmena;
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
54
hosts/sin/authelia.nix
Normal file
54
hosts/sin/authelia.nix
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.authelia.instances.main;
|
||||||
|
dataDir = /var/lib/authelia/${cfg.name};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.authelia.instances = {
|
||||||
|
main = {
|
||||||
|
enable = true;
|
||||||
|
secrets = {
|
||||||
|
jwtSecretFile = config.age.secrets.authelia-jwt.path;
|
||||||
|
storageEncryptionKeyFile = config.age.secrets.authelia-encryption.path;
|
||||||
|
sessionSecretFile = config.age.secrets.authelia-session.path;
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
theme = "light";
|
||||||
|
log.level = "debug";
|
||||||
|
|
||||||
|
authentication_backend = {
|
||||||
|
file = {
|
||||||
|
path = dataDir + "/users.yml";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
storage = {
|
||||||
|
local = {
|
||||||
|
path = dataDir + "/db.sqlite3";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
session = {
|
||||||
|
cookies = [
|
||||||
|
{
|
||||||
|
domain = "shobu.fr";
|
||||||
|
authelia_url = "https://auth.Shobu.fr";
|
||||||
|
default_redirection_url = "https://shobu.fr";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
access_control = {
|
||||||
|
default_policy = "deny";
|
||||||
|
rules = [
|
||||||
|
{
|
||||||
|
domain = "*.shobu.fr";
|
||||||
|
policy = "one_factor";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = lib.mkif cfg.enable [
|
||||||
|
"d '${dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
modulesPath,
|
modulesPath,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -16,6 +17,8 @@
|
|||||||
./secrets.nix
|
./secrets.nix
|
||||||
./coredns
|
./coredns
|
||||||
./copyparty.nix
|
./copyparty.nix
|
||||||
|
# ./authelia.nix
|
||||||
|
# ./trilium.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.kernelModules = [ "usb_storage" ];
|
boot.initrd.kernelModules = [ "usb_storage" ];
|
||||||
@@ -51,18 +54,25 @@
|
|||||||
|
|
||||||
time.timeZone = "Europe/Paris";
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
users.users = {
|
users.users = {
|
||||||
zimablade = {
|
zimablade = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [ "wheel" ];
|
extraGroups = [ "wheel" ];
|
||||||
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
shobu = {
|
shobu = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -71,10 +81,12 @@
|
|||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = map lib.lowPrio [
|
environment.systemPackages =
|
||||||
|
map lib.lowPrio [
|
||||||
pkgs.curl
|
pkgs.curl
|
||||||
pkgs.gitMinimal
|
pkgs.gitMinimal
|
||||||
] ++ (with pkgs; [
|
]
|
||||||
|
++ (with pkgs; [
|
||||||
helix
|
helix
|
||||||
httpie
|
httpie
|
||||||
btop
|
btop
|
||||||
|
|||||||
@@ -1,29 +1,76 @@
|
|||||||
{inputs, pkgs, ...}: {
|
{
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
imports = [ inputs.copyparty.nixosModules.default ];
|
imports = [ inputs.copyparty.nixosModules.default ];
|
||||||
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
|
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
|
||||||
environment.systemPackages = [ pkgs.copyparty ];
|
environment.systemPackages = [ pkgs.copyparty ];
|
||||||
services.copyparty = {
|
services.copyparty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
group = "starr";
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
p = [ 8086 ];
|
p = [ 8086 ];
|
||||||
e2dsa = true;
|
e2dsa = true;
|
||||||
e2ts = true;
|
e2ts = true;
|
||||||
z = true;
|
z = true;
|
||||||
qr = true;
|
qr = true;
|
||||||
|
xff-hdr = "X-Real-IP";
|
||||||
xff-src = "lan";
|
xff-src = "lan";
|
||||||
|
rproxy = 1;
|
||||||
http-only = true;
|
http-only = true;
|
||||||
og = true;
|
og = true;
|
||||||
shr = "/shares";
|
shr = "/shares";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
accounts = {
|
||||||
|
serhao = {
|
||||||
|
passwordFile = config.age.secrets.copyparty-serhao.path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
volumes = {
|
volumes = {
|
||||||
"/media" = {
|
"/movies" = {
|
||||||
path = "/mnt/mediacenter/media";
|
path = "/mnt/mediacenter/media/movies";
|
||||||
access = {
|
access = {
|
||||||
r = "*";
|
r = "*";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"/shows" = {
|
||||||
|
path = "/mnt/mediacenter/media/shows";
|
||||||
|
access = {
|
||||||
|
r = "*";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
"/musics" = {
|
||||||
|
path = "/mnt/mediacenter/media/musics";
|
||||||
|
access = {
|
||||||
|
r = "*";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"/mediacenter" = {
|
||||||
|
path = "/mnt/mediacenter/media";
|
||||||
|
access = {
|
||||||
|
rw = ["serhao"];
|
||||||
|
};
|
||||||
|
flags = {
|
||||||
|
e2d = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"/data" = {
|
||||||
|
path = "/mnt/data";
|
||||||
|
access = {
|
||||||
|
rwd = ["serhao"];
|
||||||
|
};
|
||||||
|
flags = {
|
||||||
|
e2d = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{...}: {
|
{ ... }:
|
||||||
|
{
|
||||||
services.coredns = {
|
services.coredns = {
|
||||||
enable = false;
|
enable = false;
|
||||||
config = ''
|
config = ''
|
||||||
|
|||||||
@@ -14,7 +14,15 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Flake outputs
|
# Flake outputs
|
||||||
outputs = inputs@{ self, nixpkgs, disko, unstable, agenix, ... }:
|
outputs =
|
||||||
|
inputs@{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
disko,
|
||||||
|
unstable,
|
||||||
|
agenix,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
# The systems supported for this flake
|
# The systems supported for this flake
|
||||||
supportedSystems = [
|
supportedSystems = [
|
||||||
@@ -22,9 +30,14 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
# Helper to provide system-specific attributes
|
# Helper to provide system-specific attributes
|
||||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
forEachSupportedSystem =
|
||||||
|
f:
|
||||||
|
nixpkgs.lib.genAttrs supportedSystems (
|
||||||
|
system:
|
||||||
|
f {
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
});
|
}
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.zimablade = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.zimablade = nixpkgs.lib.nixosSystem {
|
||||||
@@ -40,15 +53,21 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
devShells = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
# The Nix packages provided in the environment
|
# The Nix packages provided in the environment
|
||||||
# Add any you need here
|
# Add any you need here
|
||||||
packages = with pkgs; [ pkgs.disko nixos-anywhere ];
|
packages = with pkgs; [
|
||||||
|
pkgs.disko
|
||||||
|
nixos-anywhere
|
||||||
|
];
|
||||||
|
|
||||||
# Add any shell logic you want executed any time the environment is activated
|
# Add any shell logic you want executed any time the environment is activated
|
||||||
shellHook = '''';
|
shellHook = '''';
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{...}: {
|
{ ... }:
|
||||||
|
{
|
||||||
services.glances = {
|
services.glances = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"ahci"
|
||||||
|
"xhci_pci"
|
||||||
|
"usb_storage"
|
||||||
|
"usbhid"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|||||||
@@ -117,6 +117,15 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
"reclamation" = {
|
||||||
|
description = "bring back your world to life";
|
||||||
|
widget = {
|
||||||
|
type = "minecraft";
|
||||||
|
url = "udp://minecraft.shobu.fr:25665";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{pkgs, inputs, ...}: let
|
{ pkgs, inputs, ... }:
|
||||||
|
let
|
||||||
unstable = import inputs.unstable { system = pkgs.system; };
|
unstable = import inputs.unstable { system = pkgs.system; };
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
||||||
};
|
};
|
||||||
@@ -27,13 +29,44 @@ in {
|
|||||||
extraGroups = [ "jellyfin" ];
|
extraGroups = [ "jellyfin" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.sonarr.extraGroups = ["jellyfin" "radarr" "transmission" "starr"];
|
users.users.sonarr.extraGroups = [
|
||||||
users.users.radarr.extraGroups = ["jellyfin" "sonarr" "transmission" "starr"];
|
"jellyfin"
|
||||||
users.users.bazarr.extraGroups = ["jellyfin" "sonarr" "transmission" "starr" "radarr"];
|
"radarr"
|
||||||
users.users.lidarr.extraGroups = ["jellyfin" "starr" "transmission"];
|
"transmission"
|
||||||
|
"starr"
|
||||||
|
];
|
||||||
|
users.users.radarr.extraGroups = [
|
||||||
|
"jellyfin"
|
||||||
|
"sonarr"
|
||||||
|
"transmission"
|
||||||
|
"starr"
|
||||||
|
];
|
||||||
|
users.users.bazarr.extraGroups = [
|
||||||
|
"jellyfin"
|
||||||
|
"sonarr"
|
||||||
|
"transmission"
|
||||||
|
"starr"
|
||||||
|
"radarr"
|
||||||
|
];
|
||||||
|
users.users.lidarr.extraGroups = [
|
||||||
|
"jellyfin"
|
||||||
|
"starr"
|
||||||
|
"transmission"
|
||||||
|
];
|
||||||
|
|
||||||
users.users.shobu.extraGroups = [ "jellyfin" "starr" "transmission" "radarr" "sonarr" ];
|
users.users.whisparr.extraGroups = [
|
||||||
|
"jellyfin"
|
||||||
|
"starr"
|
||||||
|
"transmission"
|
||||||
|
];
|
||||||
|
|
||||||
|
users.users.shobu.extraGroups = [
|
||||||
|
"jellyfin"
|
||||||
|
"starr"
|
||||||
|
"transmission"
|
||||||
|
"radarr"
|
||||||
|
"sonarr"
|
||||||
|
];
|
||||||
|
|
||||||
users.groups = {
|
users.groups = {
|
||||||
starr = { };
|
starr = { };
|
||||||
@@ -66,7 +99,10 @@ in {
|
|||||||
lidarr = {
|
lidarr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
package = unstable.lidarr;
|
};
|
||||||
|
whisparr = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
jellyseerr = {
|
jellyseerr = {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{...}: {
|
{ ... }:
|
||||||
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
# Devices will be mounted and formatted in alphabetical order, and btrfs can only mount raids
|
# Devices will be mounted and formatted in alphabetical order, and btrfs can only mount raids
|
||||||
@@ -6,7 +7,7 @@
|
|||||||
# and the actual btrfs raid on the second disk, and the name of these entries matters!
|
# and the actual btrfs raid on the second disk, and the name of these entries matters!
|
||||||
system = {
|
system = {
|
||||||
type = "disk";
|
type = "disk";
|
||||||
device = "/dev/mmcblk0";
|
device = "/dev/sdb";
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
@@ -41,6 +42,10 @@
|
|||||||
"/root" = {
|
"/root" = {
|
||||||
mountpoint = "/";
|
mountpoint = "/";
|
||||||
};
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountpoint = "/nix";
|
||||||
|
mountOptions = [ "compress=zstd:3" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -49,39 +54,17 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
data1 = {
|
data = {
|
||||||
type = "disk";
|
type = "disk";
|
||||||
device = "/dev/sda";
|
device = "/dev/sda";
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
crypt_p1 = {
|
crypt_p = {
|
||||||
size = "100%";
|
size = "100%";
|
||||||
content = {
|
content = {
|
||||||
type = "luks";
|
type = "luks";
|
||||||
name = "p_data1"; # device-mapper name when decrypted
|
name = "p_data";
|
||||||
# Remove settings.keyFile if you want to use interactive password entry
|
|
||||||
settings = {
|
|
||||||
allowDiscards = true;
|
|
||||||
keyFile = "/dev/disk/by-uuid/2021-07-11-12-33-27-00";
|
|
||||||
keyFileSize = 4096;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
data2 = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/sdb";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
crypt_p2 = {
|
|
||||||
size = "100%";
|
|
||||||
content = {
|
|
||||||
type = "luks";
|
|
||||||
name = "p_data2";
|
|
||||||
# Remove settings.keyFile if you want to use interactive password entry
|
# Remove settings.keyFile if you want to use interactive password entry
|
||||||
settings = {
|
settings = {
|
||||||
allowDiscards = true;
|
allowDiscards = true;
|
||||||
@@ -90,19 +73,11 @@
|
|||||||
};
|
};
|
||||||
content = {
|
content = {
|
||||||
type = "btrfs";
|
type = "btrfs";
|
||||||
extraArgs = [
|
|
||||||
"-d raid0"
|
|
||||||
"/dev/mapper/p_data1" # Use decrypted mapped device, same name as defined in disk1
|
|
||||||
];
|
|
||||||
subvolumes = {
|
subvolumes = {
|
||||||
"/" = {
|
"/" = {
|
||||||
mountpoint = "/mnt/fs";
|
mountpoint = "/mnt/fs";
|
||||||
mountOptions = [ "compress=zstd:3" ];
|
mountOptions = [ "compress=zstd:3" ];
|
||||||
};
|
};
|
||||||
"/nix" = {
|
|
||||||
mountpoint = "/nix";
|
|
||||||
mountOptions = [ "compress=zstd:3" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
"/data" = {
|
"/data" = {
|
||||||
mountpoint = "/mnt/data";
|
mountpoint = "/mnt/data";
|
||||||
|
|||||||
@@ -26,7 +26,10 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 8008 8448 ];
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
8008
|
||||||
|
8448
|
||||||
|
];
|
||||||
|
|
||||||
services.matrix-synapse = {
|
services.matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -45,7 +48,10 @@
|
|||||||
x_forwarded = true;
|
x_forwarded = true;
|
||||||
resources = [
|
resources = [
|
||||||
{
|
{
|
||||||
names = [ "client" "federation" ];
|
names = [
|
||||||
|
"client"
|
||||||
|
"federation"
|
||||||
|
];
|
||||||
compress = true;
|
compress = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
21
hosts/sin/ollama.nix
Normal file
21
hosts/sin/ollama.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
# virtualisation.docker = {
|
||||||
|
# enable = true;
|
||||||
|
# storageDriver = "btrfs";
|
||||||
|
# };
|
||||||
|
|
||||||
|
services.ollama = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
loadModels = [ ];
|
||||||
|
acceleration = "cuda";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.open-webui = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
host = "0.0.0.0";
|
||||||
|
port = 8050;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{...}: {
|
{ ... }:
|
||||||
|
{
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
# captcha = {
|
# captcha = {
|
||||||
# file = ./secrets/matrix_captcha.age;
|
# file = ./secrets/matrix_captcha.age;
|
||||||
@@ -9,5 +10,22 @@
|
|||||||
file = ./secrets/airvpn_wireguard_key_env.age;
|
file = ./secrets/airvpn_wireguard_key_env.age;
|
||||||
mode = "700";
|
mode = "700";
|
||||||
};
|
};
|
||||||
|
copyparty-serhao = {
|
||||||
|
file = ./secrets/copyparty-serhao.age;
|
||||||
|
mode = "700";
|
||||||
|
owner = "copyparty";
|
||||||
|
};
|
||||||
|
authelia-jwt = {
|
||||||
|
file = ./secrets/authelia-jwt.age;
|
||||||
|
mode = "700";
|
||||||
|
};
|
||||||
|
authelia-encryption = {
|
||||||
|
file = ./secrets/authelia-encryption.age;
|
||||||
|
mode = "700";
|
||||||
|
};
|
||||||
|
authelia-session = {
|
||||||
|
file = ./secrets/authelia-session.age;
|
||||||
|
mode = "700";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
7
hosts/sin/secrets/authelia-encryption.age
Normal file
7
hosts/sin/secrets/authelia-encryption.age
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 /uqj4A L95rgX9APIgoMvkplZIYgMQDhKBOsPGOw/maymMhiks
|
||||||
|
LNfa/YBCd84iknAMk4wbQps4KMXCvrhPp2d9KkhJWHI
|
||||||
|
-> ssh-ed25519 NoSl6Q G/y6DUFTyV6Jy6KHo8yc+xxtu3aJtTOF3Ldmxq3FmyE
|
||||||
|
FOExj321S/VIPQ/qdvZBcJ930HI/GsjDVjJp9WMSXLA
|
||||||
|
--- iIpq/CWng+4+kQbvJQb/qgejr/eza94wCkegEJ2dvno
|
||||||
|
ÿNôU*1=DÔOˆ£W6]_â©Kà=©*ÊÞký¦_ù˜ÝøÉ‡™tmË•ãw°
|
||||||
7
hosts/sin/secrets/authelia-jwt.age
Normal file
7
hosts/sin/secrets/authelia-jwt.age
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 /uqj4A i6SPCzjkGrPMjhC9NQDdYTk3fzXoD4OSQdhS1togN0A
|
||||||
|
Lqus8sROz1O4EepauPwC4RX/qH+SnDiL2H5iZGtAhXo
|
||||||
|
-> ssh-ed25519 NoSl6Q LxV4a5HiB6qfPjbba75dkVVECzaqrMjksMXHh53JbGQ
|
||||||
|
x4POzurz+J2mymT81M+cu69Iv/MeiYt+JvaRteinm5Q
|
||||||
|
--- OFqooyZ2HPBxP756PqpgJAyVOTkqhJ0LhEQsLJBZUtE
|
||||||
|
—>»&Ȇw·\D„Au{õz{CˆÁ~á$‘_ˆ9»¢ZZ<5A>U^„ÎÊL!(lnпÂó‰Üv{fdº 1Ýßl¢,<2C>|<7C>Ü.¤çH«¤³êVaù¥ÍÓˆ™PêwOo3ž
|
||||||
7
hosts/sin/secrets/authelia-session.age
Normal file
7
hosts/sin/secrets/authelia-session.age
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 /uqj4A eff535EaT7gEZOacWx9raBJMdd4PPd9+y6Y3eOt1wBI
|
||||||
|
5P4aefjWVJ4L11ff+Cg8j3gQ58I+agDPUMFWiCaL/sQ
|
||||||
|
-> ssh-ed25519 NoSl6Q 3+EZtaiiZQk7JK6zCNo/nUSSRAJzf8nal2X1sFkYmxo
|
||||||
|
f5gzpiOtCbYdiV7vOxfZvJPRmRruTbHg6T8g0r5JRgc
|
||||||
|
--- BBL3wE2eSmHVI4tlhq+5fy84cauw6P6G69nFXuObLKE
|
||||||
|
êéæí @[¡SÓcñ‘<C3B1>SyÉŠ‡<; í†<C3AD>e±Ë茟<C592><C5B8>§(°Æž1\Yj›È¯½½4åõ Ýȹ.3>Â[Èq¢Jh8í·šÕVt”øX[Ì~[(#^‘_5€§<E282AC>
|
||||||
7
hosts/sin/secrets/copyparty-serhao.age
Normal file
7
hosts/sin/secrets/copyparty-serhao.age
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 BoEq8A O6x9n4kvpqLucX7NuNeD2SsMmvT5n6aVYwo4nQt21H8
|
||||||
|
R+4g1QuXtxovyv5Mav+mAhgGjOcGQW4q17FSBtzXZQo
|
||||||
|
-> ssh-ed25519 NoSl6Q iKPipXfIGWxUobXF/9CSRhc/zKgmKKWWZhDTDgX0jWA
|
||||||
|
LB4TFCdbEG0VToYzTWdFedd0duF5PKlCnpBs4nBbLAQ
|
||||||
|
--- D7VE3Mwgx9ehk5rNuHm62S5ggQBm9wJodZa61jLEVsY
|
||||||
|
8ÔîÐÄÒë`S«šéT¯Fª9&(½Ú²Á‡¸=~Ïášoù».X޶ž7ðV&'Øøå ÒÔ¸‹%ã î
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
{config, ...}: {
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
|
||||||
users.users."starr" = {
|
users.users."starr" = {
|
||||||
extraGroups = [ "transmission" ];
|
extraGroups = [ "transmission" ];
|
||||||
@@ -14,9 +20,28 @@
|
|||||||
transmission.gid = 989;
|
transmission.gid = 989;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.oci-containers = let
|
# systemd.services = {
|
||||||
|
# docker-transmission-network = {
|
||||||
|
# after = [
|
||||||
|
# "network.target"
|
||||||
|
# "docker-gluetun.service"
|
||||||
|
# "docker-transmission.service"
|
||||||
|
# ];
|
||||||
|
# wantedBy = [
|
||||||
|
# "docker-gluetun.service"
|
||||||
|
# "docker-transmission.service"
|
||||||
|
# ];
|
||||||
|
# serviceConfig = {
|
||||||
|
# ExecStart = "${lib.getExe pkgs.docker} network create docker-transmission; exit 0";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
|
||||||
|
virtualisation.oci-containers =
|
||||||
|
let
|
||||||
peerport = "63369";
|
peerport = "63369";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
backend = "docker";
|
backend = "docker";
|
||||||
containers = {
|
containers = {
|
||||||
gluetun = {
|
gluetun = {
|
||||||
@@ -36,6 +61,7 @@
|
|||||||
extraOptions = [
|
extraOptions = [
|
||||||
"--cap-add=NET_ADMIN"
|
"--cap-add=NET_ADMIN"
|
||||||
"--device=/dev/net/tun"
|
"--device=/dev/net/tun"
|
||||||
|
# "--network=docker-transmission"
|
||||||
];
|
];
|
||||||
ports = [
|
ports = [
|
||||||
"13277:13277"
|
"13277:13277"
|
||||||
|
|||||||
1
hosts/sin/trilium.nix
Normal file
1
hosts/sin/trilium.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{ ... }: { }
|
||||||
@@ -2,19 +2,24 @@
|
|||||||
# your system. Help is available in the configuration.nix(5) man page, on
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
{ config, lib, pkgs, nodes, ... }:let
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
nodes,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
sin-address = "192.168.1.14";
|
sin-address = "192.168.1.14";
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[
|
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
# ./striped
|
# ./striped
|
||||||
# ./cybercoffee
|
# ./cybercoffee
|
||||||
./ollama.nix
|
./ollama.nix
|
||||||
./minecraft.nix
|
./minecraft.nix
|
||||||
# ./shares.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
@@ -31,24 +36,36 @@ in
|
|||||||
# dhcpcd.extraConfig = "nohook resolv.conf";
|
# dhcpcd.extraConfig = "nohook resolv.conf";
|
||||||
|
|
||||||
firewall = {
|
firewall = {
|
||||||
allowedTCPPorts = [ nodes.sin.config.services.gitea.settings.server.SSH_PORT ];
|
allowedTCPPorts = [
|
||||||
|
nodes.sin.config.services.gitea.settings.server.SSH_PORT
|
||||||
|
]
|
||||||
|
++ [
|
||||||
|
# minecraft ad hoc server ports
|
||||||
|
25665
|
||||||
|
25675
|
||||||
|
];
|
||||||
};
|
};
|
||||||
nat = {
|
nat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
internalInterfaces = [ "enp1s0" ];
|
internalInterfaces = [ "enp1s0" ];
|
||||||
externalInterface = "enp1s0";
|
externalInterface = "enp1s0";
|
||||||
forwardPorts = [ {
|
forwardPorts = [
|
||||||
|
{
|
||||||
# TODO refactor this in the gitea/n100 module
|
# TODO refactor this in the gitea/n100 module
|
||||||
sourcePort = nodes.sin.config.services.gitea.settings.server.SSH_PORT;
|
sourcePort = nodes.sin.config.services.gitea.settings.server.SSH_PORT;
|
||||||
proto = "tcp";
|
proto = "tcp";
|
||||||
destination = "${sin-address}:22";
|
destination = "${sin-address}:22";
|
||||||
} ];
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
time.timeZone = "Europe/Paris";
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [
|
||||||
|
"nix-command"
|
||||||
|
"flakes"
|
||||||
|
];
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
users.users.n100 = {
|
users.users.n100 = {
|
||||||
@@ -57,14 +74,17 @@ in
|
|||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
];
|
];
|
||||||
|
|
||||||
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.root = {
|
users.users.root = {
|
||||||
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
lunarvim
|
lunarvim
|
||||||
wget
|
wget
|
||||||
@@ -112,4 +132,3 @@ in
|
|||||||
system.stateVersion = "24.11"; # Did you read the comment?
|
system.stateVersion = "24.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
|
|
||||||
{ ... }: { }
|
{ ... }: { }
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Flake outputs
|
# Flake outputs
|
||||||
outputs = inputs@{
|
outputs =
|
||||||
|
inputs@{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
nix-minecraft,
|
nix-minecraft,
|
||||||
|
|||||||
@@ -1,46 +1,60 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports = [
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "sdhci_pci" ];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" = {
|
||||||
{ device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=root" ];
|
options = [ "subvol=root" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" =
|
fileSystems."/nix" = {
|
||||||
{ device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=nix" ];
|
options = [ "subvol=nix" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" =
|
fileSystems."/home" = {
|
||||||
{ device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=home" ];
|
options = [ "subvol=home" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/swap" =
|
fileSystems."/swap" = {
|
||||||
{ device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
device = "/dev/disk/by-uuid/09c733e4-b0df-4416-977b-50d9feb225fc";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=swap" ];
|
options = [ "subvol=swap" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" = {
|
||||||
{ device = "/dev/disk/by-uuid/D1B9-8019";
|
device = "/dev/disk/by-uuid/D1B9-8019";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [ "fmask=0077" "dmask=0077" ];
|
options = [
|
||||||
|
"fmask=0077"
|
||||||
|
"dmask=0077"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
{pkgs, inputs, ...}:
|
{
|
||||||
|
pkgs,
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
modpack = pkgs.fetchPackwizModpack {
|
modpack = pkgs.fetchPackwizModpack {
|
||||||
url = "file:///${inputs.testing-grounds.modpack}/pack.toml";
|
url = "file:///${inputs.testing-grounds.modpack}/pack.toml";
|
||||||
|
|||||||
@@ -3,9 +3,14 @@ let
|
|||||||
# striped-front = inputs.striped-front;
|
# striped-front = inputs.striped-front;
|
||||||
|
|
||||||
sin-address = "192.168.1.14";
|
sin-address = "192.168.1.14";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 8448 ];
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
80
|
||||||
|
443
|
||||||
|
8448
|
||||||
|
];
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -37,8 +42,8 @@ in {
|
|||||||
// mkStarr "prowlarr.shobu.fr" "9696"
|
// mkStarr "prowlarr.shobu.fr" "9696"
|
||||||
// mkStarr "bazarr.shobu.fr" "6767"
|
// mkStarr "bazarr.shobu.fr" "6767"
|
||||||
// mkStarr "jellyseerr.shobu.fr" "5055"
|
// mkStarr "jellyseerr.shobu.fr" "5055"
|
||||||
// mkStarr "fileshelter.shobu.fr" "5091"
|
|
||||||
// mkStarr "lidarr.shobu.fr" "8686"
|
// mkStarr "lidarr.shobu.fr" "8686"
|
||||||
|
// mkStarr "whisparr.shobu.fr" "6969"
|
||||||
// mkStarr "transmission.shobu.fr" "9091"
|
// mkStarr "transmission.shobu.fr" "9091"
|
||||||
// mkStarr "zimablade-admin.shobu.fr" "61208"
|
// mkStarr "zimablade-admin.shobu.fr" "61208"
|
||||||
// {
|
// {
|
||||||
@@ -105,6 +110,10 @@ in {
|
|||||||
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${sin-address}:8086";
|
proxyPass = "http://${sin-address}:8086";
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
client_max_body_size 100M;
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# "matrix.shobu.fr" = {
|
# "matrix.shobu.fr" = {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{inputs, ...}: {
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
# virtualisation.docker = {
|
# virtualisation.docker = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
# storageDriver = "btrfs";
|
# storageDriver = "btrfs";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{...}: let
|
{ ... }:
|
||||||
|
let
|
||||||
sin-address = "192.168.1.14";
|
sin-address = "192.168.1.14";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
let
|
let
|
||||||
striped-back = inputs.striped-back;
|
striped-back = inputs.striped-back;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
striped-back.nixosModules.default
|
striped-back.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{striped-back, striped-front, ...}:{
|
{ striped-back, striped-front, ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./back.nix
|
./back.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{lib, ...}: let
|
{ lib, ... }:
|
||||||
|
let
|
||||||
ssh_port = 24658;
|
ssh_port = 24658;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
services = {
|
services = {
|
||||||
gitea = {
|
gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
text = ''
|
text = ''
|
||||||
container:
|
container:
|
||||||
network: "host"
|
network: "host"
|
||||||
|
valid_volumes:
|
||||||
|
- "/var/nix/hosted-store"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
11
scripts/upload-to-cache.sh
Normal file
11
scripts/upload-to-cache.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -eu
|
||||||
|
set -f
|
||||||
|
|
||||||
|
if ! nix --version; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
export IFS=' '
|
||||||
|
echo "Uploading paths" $OUT_PATHS
|
||||||
|
exec nix copy --to "ssh://root@localhost" $OUT_PATHS
|
||||||
Reference in New Issue
Block a user