9 Commits

Author SHA1 Message Date
shobu
cda4de62b6 old nix
Some checks failed
/ Build Nix targets (push) Successful in 25s
/ build hive configuration (push) Failing after 3m29s
2025-11-12 04:47:59 +01:00
shobu
d6e8d81ef0 old nix
Some checks failed
/ Build Nix targets (push) Successful in 26s
/ build hive configuration (push) Failing after 19s
2025-11-12 04:46:23 +01:00
shobu
e1d2f10b6a old nix
Some checks failed
/ Build Nix targets (push) Successful in 27s
/ build hive configuration (push) Failing after 3m35s
2025-11-12 04:35:54 +01:00
shobu
668c8de2e7 test
Some checks failed
/ Build Nix targets (push) Successful in 26s
/ build hive configuration (push) Failing after 3m37s
2025-11-12 04:31:00 +01:00
shobu
82e03ed59b test
Some checks failed
/ Build Nix targets (push) Successful in 27s
/ build hive configuration (push) Failing after 15s
2025-11-12 04:28:08 +01:00
shobu
d41b153dbb fix prev
Some checks failed
/ Build Nix targets (push) Successful in 26s
/ build hive configuration (push) Failing after 3m34s
2025-11-12 04:19:37 +01:00
shobu
c901116678 test
Some checks failed
/ Build Nix targets (push) Successful in 44s
/ build hive configuration (push) Failing after 19s
2025-11-12 04:15:22 +01:00
shobu
26ac144938 directly run the nix-develop repo
Some checks failed
/ Build Nix targets (push) Successful in 30s
/ build hive configuration (push) Failing after 3m52s
2025-11-12 00:30:41 +01:00
shobu
10bcea2d77 remove cachix usage
Some checks failed
/ Build Nix targets (push) Successful in 31s
/ build hive configuration (push) Failing after 1m40s
2025-11-12 00:19:14 +01:00
34 changed files with 616 additions and 956 deletions

View File

@@ -1,15 +0,0 @@
on: [push]
jobs:
analysis:
permissions:
contents: read
id-token: write
name: perform flake analysis
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check Nix flake inputs
uses: http://github.com/DeterminateSystems/flake-checker-action@main

View File

@@ -0,0 +1,14 @@
on: [push]
jobs:
build:
name: Build Nix targets
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: http://github.com/cachix/install-nix-action@v18
- uses: http://github.com/cachix/cachix-action@v12
with:
name: statix
- name: Check Nix flake inputs
uses: http://github.com/DeterminateSystems/flake-checker-action@main

View File

@@ -1,43 +0,0 @@
on:
push:
branches:
- master
jobs:
deploy:
container:
volumes:
- /nix/store:/var/nix/hosted-store
permissions:
contents: read
id-token: write
name: build hive configuration
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: setup
env:
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:
extra_nix_config: |
extra-trusted-public-keys = localhost:TiRpr2LzamX/MCKBUmFlZ8inWz94QWGL88fMEHg9Kgc=
extra-substituters = "local?store=/var/nix/hosted-store&priority=20"
secret-key-files = /var/secrets/cache_privkey
post-build-hook = /etc/nix/upload-to-cache.sh
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- uses: http://github.com/cachix/cachix-action@v16
with:
name: colmena
- run: nix run .#colmena apply

View File

@@ -0,0 +1,17 @@
on:
push:
branches:
- master
- test-deploy
jobs:
build:
name: build hive configuration
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
with:
install_url: https://releases.nixos.org/nix/nix-2.20.0/install
- uses: https://github.com/nicknovitski/nix-develop@v1
- run: colmena apply

299
flake.lock generated
View File

@@ -49,11 +49,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1767637959, "lastModified": 1762095388,
"narHash": "sha256-+gBU5Cj9QNpHLQ5PHJoWNQft7TMsBM6X+tDQg+/B2P0=", "narHash": "sha256-7Q8LtcvKWHbP8znARRTOY2tpU5WoV6FHwp5TZJOI8Us=",
"owner": "9001", "owner": "9001",
"repo": "copyparty", "repo": "copyparty",
"rev": "038af507772593b904b5c3efc306f89cbdf2b6fb", "rev": "ac085b8149ff50e03d260128596dd130ed1c7cae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -91,11 +91,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1766150702, "lastModified": 1762276996,
"narHash": "sha256-P0kM+5o+DKnB6raXgFEk3azw8Wqg5FL6wyl9jD+G5a4=", "narHash": "sha256-TtcPgPmp2f0FAnc+DMEw4ardEgv1SGNR3/WFGH0N19M=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "916506443ecd0d0b4a0f4cf9d40a3c22ce39b378", "rev": "af087d076d3860760b3323f6b583f4d828c1ac17",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -136,22 +136,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
@@ -200,24 +184,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -267,31 +233,11 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1767147099, "lastModified": 1762826586,
"narHash": "sha256-395ehjdAtaqCbKmx+PhKAqnkYLvTtAzq2qzFG9qaGDw=", "narHash": "sha256-KlPcXOxxyv+KNcf7yNFQ4DGVFbOpITqHfvMcAUYrL7E=",
"owner": "Infinidoge", "owner": "Infinidoge",
"repo": "nix-minecraft", "repo": "nix-minecraft",
"rev": "01f571579edd64433f97c4294137fbc366deef4b", "rev": "1a4fa22ec6e9f2ece24fca273352463b75f6f7c0",
"type": "github"
},
"original": {
"owner": "Infinidoge",
"repo": "nix-minecraft",
"type": "github"
}
},
"nix-minecraft_2": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1767147099,
"narHash": "sha256-395ehjdAtaqCbKmx+PhKAqnkYLvTtAzq2qzFG9qaGDw=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "01f571579edd64433f97c4294137fbc366deef4b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -365,11 +311,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1767313136, "lastModified": 1762756533,
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", "narHash": "sha256-HiRDeUOD1VLklHeOmaKDzf+8Hb7vSWPVFcWwaTrpm+U=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", "rev": "c2448301fb856e351aab33e64c33a3fc8bcf637d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -380,36 +326,6 @@
} }
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": {
"lastModified": 1748929857,
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1767364772,
"narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_8": {
"locked": { "locked": {
"lastModified": 1737062831, "lastModified": 1737062831,
"narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=",
@@ -423,6 +339,36 @@
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
} }
}, },
"nixpkgs_7": {
"locked": {
"lastModified": 1744440957,
"narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1744463964,
"narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=",
"rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650",
"revCount": 782401,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.782401%2Brev-2631b0b7abcea6e640ce31cd78ea58910d31e650/01962c8a-63c4-7abd-a3df-63a17b548cc7/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
}
},
"nixpkgs_9": { "nixpkgs_9": {
"locked": { "locked": {
"lastModified": 1736549401, "lastModified": 1736549401,
@@ -439,24 +385,54 @@
"type": "github" "type": "github"
} }
}, },
"reclamation": { "pyproject-build-systems": {
"inputs": { "inputs": {
"nix-minecraft": "nix-minecraft_2", "nixpkgs": [
"nixpkgs": "nixpkgs_7", "striped-back",
"utils": "utils" "nixpkgs"
],
"pyproject-nix": [
"striped-back",
"pyproject-nix"
],
"uv2nix": [
"striped-back",
"uv2nix"
]
}, },
"locked": { "locked": {
"lastModified": 1767786101, "lastModified": 1744599653,
"narHash": "sha256-ENlpYr2V5u0/Enq07nIHfzetqmS95aydQYIM6sISVUc=", "narHash": "sha256-nysSwVVjG4hKoOjhjvE6U5lIKA8sEr1d1QzEfZsannU=",
"ref": "refs/heads/master", "owner": "pyproject-nix",
"rev": "b71acff364b7b5eb3e1b68915aeb379053b86c94", "repo": "build-system-pkgs",
"revCount": 10, "rev": "7dba6dbc73120e15b558754c26024f6c93015dd7",
"type": "git", "type": "github"
"url": "https://git.shobu.fr/sin_serhao/reclamation"
}, },
"original": { "original": {
"type": "git", "owner": "pyproject-nix",
"url": "https://git.shobu.fr/sin_serhao/reclamation" "repo": "build-system-pkgs",
"type": "github"
}
},
"pyproject-nix": {
"inputs": {
"nixpkgs": [
"striped-back",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743438845,
"narHash": "sha256-1GSaoubGtvsLRwoYwHjeKYq40tLwvuFFVhGrG8J9Oek=",
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"rev": "8063ec98edc459571d042a640b1c5e334ecfca1e",
"type": "github"
},
"original": {
"owner": "pyproject-nix",
"repo": "pyproject.nix",
"type": "github"
} }
}, },
"root": { "root": {
@@ -467,15 +443,16 @@
"disko": "disko", "disko": "disko",
"nix-minecraft": "nix-minecraft", "nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_5",
"reclamation": "reclamation",
"shoblog-front": "shoblog-front", "shoblog-front": "shoblog-front",
"striped-back": "striped-back",
"striped-front": "striped-front",
"testing-grounds": "testing-grounds", "testing-grounds": "testing-grounds",
"unstable": "unstable" "unstable": "unstable"
} }
}, },
"shoblog-front": { "shoblog-front": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_8" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1752594581, "lastModified": 1752594581,
@@ -507,6 +484,45 @@
"type": "github" "type": "github"
} }
}, },
"striped-back": {
"inputs": {
"nixpkgs": "nixpkgs_7",
"pyproject-build-systems": "pyproject-build-systems",
"pyproject-nix": "pyproject-nix",
"uv2nix": "uv2nix"
},
"locked": {
"lastModified": 1748719386,
"narHash": "sha256-nyXHemXPEKnqIVIYIorSbt64zRwMvijyGQGCW3zUUkc=",
"ref": "refs/heads/master",
"rev": "bdfd6f1f4aac6a00ae4509f14b3a63c84d169edf",
"revCount": 8,
"type": "git",
"url": "ssh://git@gitlab.com/striped1/striped-back"
},
"original": {
"type": "git",
"url": "ssh://git@gitlab.com/striped1/striped-back"
}
},
"striped-front": {
"inputs": {
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1748718798,
"narHash": "sha256-KUxbrUjRfuKjkJZLzKr11WEXLfPs38YrW/CMG6XbnbY=",
"ref": "refs/heads/master",
"rev": "a553f10147dad9e41829f67b247817a079f6f671",
"revCount": 11,
"type": "git",
"url": "ssh://git@gitlab.com/striped1/striped-front"
},
"original": {
"type": "git",
"url": "ssh://git@gitlab.com/striped1/striped-front"
}
},
"systems": { "systems": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@@ -537,36 +553,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"testing-grounds": { "testing-grounds": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_9" "nixpkgs": "nixpkgs_9"
@@ -587,11 +573,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1767640445, "lastModified": 1762596750,
"narHash": "sha256-UWYqmD7JFBEDBHWYcqE6s6c77pWdcU/i+bwD6XxMb8A=", "narHash": "sha256-rXXuz51Bq7DHBlfIjN7jO8Bu3du5TV+3DSADBX7/9YQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9f0c42f8bc7151b8e7e5840fb3bd454ad850d8c5", "rev": "b6a8526db03f735b89dd5ff348f53f752e7ddc8e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -601,21 +587,28 @@
"type": "github" "type": "github"
} }
}, },
"utils": { "uv2nix": {
"inputs": { "inputs": {
"systems": "systems_4" "nixpkgs": [
"striped-back",
"nixpkgs"
],
"pyproject-nix": [
"striped-back",
"pyproject-nix"
]
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1744797880,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-gt9JBkYjZAEvGwCG7RMAAAr0j2RsaRmOMj/vV0briXk=",
"owner": "numtide", "owner": "pyproject-nix",
"repo": "flake-utils", "repo": "uv2nix",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "rev": "3583e037163491ecd833f1d5d3eedf3869543c5d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "pyproject-nix",
"repo": "flake-utils", "repo": "uv2nix",
"type": "github" "type": "github"
} }
} }

172
flake.nix
View File

@@ -17,36 +17,33 @@
# sin inputs # sin inputs
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";
reclamation.url = "git+https://git.shobu.fr/sin_serhao/reclamation";
shoblog-front.url = "gitlab:shobu13/shoblog"; shoblog-front.url = "gitlab:shobu13/shoblog";
# striped-front.url = "git+ssh://git@gitlab.com/striped1/striped-front"; striped-front.url = "git+ssh://git@gitlab.com/striped1/striped-front";
# striped-back.url = "git+ssh://git@gitlab.com/striped1/striped-back"; 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 = outputs = inputs@{
inputs@{ self,
self,
nixpkgs,
unstable,
colmena,
nixpkgs, agenix,
unstable,
colmena,
agenix, disko,
disko, shoblog-front,
striped-front,
shoblog-front, striped-back,
# striped-front, nix-minecraft,
# striped-back, testing-grounds,
nix-minecraft, copyparty,
testing-grounds, ...
reclamation,
copyparty,
...
}: }:
let let
# The systems supported for this flake # The systems supported for this flake
@@ -55,41 +52,16 @@
]; ];
# Helper to provide system-specific attributes # Helper to provide system-specific attributes
forEachSupportedSystem = forEachSupportedSystem = f: inputs.nixpkgs.lib.genAttrs supportedSystems (system: f {
f: pkgs = import inputs.nixpkgs { inherit system; };
inputs.nixpkgs.lib.genAttrs supportedSystems ( });
system:
f {
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 {
system = "x86_64-linux"; system = "x86_64-linux";
overlays = [ ]; overlays = [];
}; };
specialArgs = { specialArgs = {
@@ -97,75 +69,45 @@
}; };
}; };
thea = thea = {name, nodes, pkgs, ...}: {
{ imports = [
name, ./hosts/${name}/configuration.nix
nodes, ./hosts/${name}/hardware-configuration.nix
pkgs, ] ++ [
... # modules
}: ./modules/gitea/${name}
{ ];
imports = [
agenix.nixosModules.default
./hosts/${name}/configuration.nix
./hosts/${name}/hardware-configuration.nix
]
++ [
# modules
./modules/gitea/${name}
];
deployment.targetHost = "192.168.1.12"; deployment.targetHost = "192.168.1.12";
}; };
sin = sin = {name, nodes, pkgs, ...}: {
{ imports = [
name, disko.nixosModules.disko
nodes, agenix.nixosModules.default
pkgs, ./hosts/${name}/configuration.nix
... ./hosts/${name}/hardware-configuration.nix
}: ] ++ [
{ # modules
imports = [ ./modules/gitea/${name}
disko.nixosModules.disko ];
agenix.nixosModules.default
./hosts/${name}/configuration.nix
./hosts/${name}/hardware-configuration.nix
]
++ [
# modules
./modules/gitea/${name}
];
deployment.targetHost = "192.168.1.14"; deployment.targetHost = "192.168.1.14";
deployment.allowLocalDeployment = true; };
};
}; };
devShells = forEachSupportedSystem ( devShells = forEachSupportedSystem ({ pkgs }: {
{ pkgs }: default = pkgs.mkShell {
{ # The Nix packages provided in the environment
default = pkgs.mkShell { # Add any you need here
# The Nix packages provided in the environment packages = with pkgs; [ colmena.packages.${pkgs.system}.colmena ];
# Add any you need here
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 }:
{
inherit (colmena.packages."${pkgs.system}") colmena;
}
);
}; };
} }

View File

@@ -2,7 +2,6 @@
modulesPath, modulesPath,
lib, lib,
pkgs, pkgs,
config,
... ...
}: }:
{ {
@@ -52,45 +51,36 @@
time.timeZone = "Europe/Paris"; time.timeZone = "Europe/Paris";
nix.settings.experimental-features = [ nix.settings.experimental-features = [ "nix-command" "flakes" ];
"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 = [ openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
];
}; };
shobu = { shobu = {
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
];
}; };
}; };
users.users.root.openssh.authorizedKeys.keys = [ users.users.root.openssh.authorizedKeys.keys = [
# change this to your ssh key # change this to your ssh key
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
]; ];
environment.systemPackages = environment.systemPackages = map lib.lowPrio [
map lib.lowPrio [ pkgs.curl
pkgs.curl pkgs.gitMinimal
pkgs.gitMinimal ] ++ (with pkgs; [
] helix
++ (with pkgs; [ httpie
helix btop
httpie tmux
btop # firefox
tmux ]);
# firefox
]);
services = { services = {
openssh = { openssh = {

View File

@@ -1,27 +1,17 @@
{ {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";

View File

@@ -1,5 +1,4 @@
{ ... }: {...}: {
{
services.coredns = { services.coredns = {
enable = false; enable = false;
config = '' config = ''
@@ -9,7 +8,7 @@
cache cache
file ${./db.homelab.local} file ${./db.homelab.local}
} }
. { . {
forward . 8.8.8.8 forward . 8.8.8.8
log log

View File

@@ -14,15 +14,7 @@
}; };
# Flake outputs # Flake outputs
outputs = outputs = inputs@{ self, nixpkgs, disko, unstable, agenix, ... }:
inputs@{
self,
nixpkgs,
disko,
unstable,
agenix,
...
}:
let let
# The systems supported for this flake # The systems supported for this flake
supportedSystems = [ supportedSystems = [
@@ -30,14 +22,9 @@
]; ];
# Helper to provide system-specific attributes # Helper to provide system-specific attributes
forEachSupportedSystem = forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
f: pkgs = import nixpkgs { inherit system; };
nixpkgs.lib.genAttrs supportedSystems ( });
system:
f {
pkgs = import nixpkgs { inherit system; };
}
);
in in
{ {
nixosConfigurations.zimablade = nixpkgs.lib.nixosSystem { nixosConfigurations.zimablade = nixpkgs.lib.nixosSystem {
@@ -53,21 +40,15 @@
}; };
}; };
devShells = forEachSupportedSystem ( devShells = forEachSupportedSystem ({ pkgs }: {
{ pkgs }: default = pkgs.mkShell {
{ # The Nix packages provided in the environment
default = pkgs.mkShell { # Add any you need here
# The Nix packages provided in the environment packages = with pkgs; [ pkgs.disko nixos-anywhere ];
# Add any you need here
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 = '''';
}; };
} });
);
}; };
} }

View File

@@ -1,5 +1,4 @@
{ ... }: {...}: {
{
services.glances = { services.glances = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;

View File

@@ -1,39 +1,26 @@
# 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, imports =
modulesPath, [ (modulesPath + "/installer/scan/not-detected.nix")
... ];
}:
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ];
{ boot.initrd.kernelModules = [ ];
imports = [ boot.kernelModules = [ "kvm-intel" ];
(modulesPath + "/installer/scan/not-detected.nix") boot.extraModulePackages = [ ];
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
boot.initrd.availableKernelModules = [ # (the default) this is the recommended approach. When using systemd-networkd it's
"ahci" # still possible to use this option, but it's recommended to use it in conjunction
"xhci_pci" # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
"usb_storage" networking.useDHCP = lib.mkDefault true;
"usbhid" # networking.interfaces.enp0s21f0u3u4.useDHCP = lib.mkDefault true;
"sd_mod" # networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
"sdhci_pci"
]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
boot.initrd.kernelModules = [ ]; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
boot.kernelModules = [ "kvm-intel" ]; }
boot.extraModulePackages = [ ];
# 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.enp0s21f0u3u4.useDHCP = lib.mkDefault true;
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,12 +1,12 @@
{ inputs, pkgs, ... }:
{ {inputs, pkgs, ...}: {
services.homepage-dashboard = { services.homepage-dashboard = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
allowedHosts = "dashboard.shobu.fr"; allowedHosts = "dashboard.shobu.fr";
settings = { settings = {
title = "Shobu's homelab dashboard"; title = "Shobu's homelab dashboard";
description = "a dashboard of free and awesome bullshit"; description = "a dashboard of free and wesome bullshit";
startUrl = "https://dashboard.shobu.fr"; startUrl = "https://dashboard.shobu.fr";
base = "https://dashboard.shobu.fr"; base = "https://dashboard.shobu.fr";
headerStyle = "boxed"; headerStyle = "boxed";
@@ -14,9 +14,9 @@
providers = { providers = {
"finnhub" = "cuvq5e9r01qub8tv03g0cuvq5e9r01qub8tv03gg"; "finnhub" = "cuvq5e9r01qub8tv03g0cuvq5e9r01qub8tv03gg";
}; };
layout = [ layout = [
{ "resources" = { }; } {"resources" = {};}
{ {
"about me stuff" = { "about me stuff" = {
tab = "Public"; tab = "Public";
@@ -38,13 +38,13 @@
header = false; header = false;
}; };
} }
]; ];
}; };
widgets = [ widgets = [
{ {
greeting = { greeting = {
text = "Welcome on my services and links dashboard, make yourself home. :3"; text = "Welcome on my services and links dashboard, make yourself home.";
}; };
} }
{ {
@@ -78,7 +78,7 @@
icon = "https://bddtrans.shobu.fr/favicon.ico"; icon = "https://bddtrans.shobu.fr/favicon.ico";
href = "https://bddtrans.shobu.fr"; href = "https://bddtrans.shobu.fr";
} }
]; ];
} }
]; ];
} }
@@ -103,7 +103,7 @@
]; ];
} }
]; ];
services = [ services = [
{ {
"gayming" = [ "gayming" = [
@@ -117,15 +117,6 @@
}; };
}; };
} }
{
"reclamation" = {
description = "bring back your world to life";
widget = {
type = "minecraft";
url = "udp://minecraft.shobu.fr:43001";
};
};
}
]; ];
} }
{ {
@@ -155,7 +146,7 @@
type = "jellyseerr"; type = "jellyseerr";
url = "https://jellyseerr.shobu.fr"; url = "https://jellyseerr.shobu.fr";
key = "MTczNzkyNzMxMzgwODk4N2FlZWJkLTQ0N2QtNGU0MS1iOWE1LTJmZmE3OTI4ZGQ5OQ=="; key = "MTczNzkyNzMxMzgwODk4N2FlZWJkLTQ0N2QtNGU0MS1iOWE1LTJmZmE3OTI4ZGQ5OQ==";
}; };
}; };
} }
{ {

View File

@@ -1,8 +1,6 @@
{ pkgs, inputs, ... }: {pkgs, inputs, ...}: let
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; };
}; };
@@ -29,49 +27,24 @@ in
extraGroups = [ "jellyfin" ]; extraGroups = [ "jellyfin" ];
}; };
users.users.sonarr.extraGroups = [ users.users.sonarr.extraGroups = ["jellyfin" "radarr" "transmission" "starr"];
"jellyfin" users.users.radarr.extraGroups = ["jellyfin" "sonarr" "transmission" "starr"];
"radarr" users.users.bazarr.extraGroups = ["jellyfin" "sonarr" "transmission" "starr" "radarr"];
"transmission" users.users.lidarr.extraGroups = ["jellyfin" "starr" "transmission"];
"starr"
]; users.users.shobu.extraGroups = [ "jellyfin" "starr" "transmission" "radarr" "sonarr" ];
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.groups = { users.groups = {
starr = { }; starr = {};
}; };
services = { services = {
jellyfin = { jellyfin = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
}; };
sonarr = { sonarr = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
@@ -95,7 +68,7 @@ in
openFirewall = true; openFirewall = true;
package = unstable.lidarr; package = unstable.lidarr;
}; };
jellyseerr = { jellyseerr = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;

View File

@@ -1,5 +1,4 @@
{ ... }: {...}: {
{
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
@@ -50,17 +49,39 @@
}; };
}; };
data = { data1 = {
type = "disk"; type = "disk";
device = "/dev/sda"; device = "/dev/sda";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
crypt_p = { crypt_p1 = {
size = "100%"; size = "100%";
content = { content = {
type = "luks"; type = "luks";
name = "p_data"; name = "p_data1"; # device-mapper name when decrypted
# 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;
@@ -69,6 +90,10 @@
}; };
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";
@@ -77,7 +102,7 @@
"/nix" = { "/nix" = {
mountpoint = "/nix"; mountpoint = "/nix";
mountOptions = [ "compress=zstd:3" ]; mountOptions = [ "compress=zstd:3" ];
}; };
"/data" = { "/data" = {
mountpoint = "/mnt/data"; mountpoint = "/mnt/data";

View File

@@ -1,4 +1,4 @@
{ pkgs, config, ... }: {pkgs, config, ...}:
{ {
users.users = { users.users = {
postgres = { postgres = {
@@ -26,10 +26,7 @@
''; '';
}; };
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [ 8008 8448 ];
8008
8448
];
services.matrix-synapse = { services.matrix-synapse = {
enable = true; enable = true;
@@ -42,16 +39,13 @@
listeners = [ listeners = [
{ {
port = 8008; port = 8008;
bind_addresses = [ "0.0.0.0" ]; bind_addresses = ["0.0.0.0"];
type = "http"; type = "http";
tls = false; tls = false;
x_forwarded = true; x_forwarded = true;
resources = [ resources = [
{ {
names = [ names = [ "client" "federation" ];
"client"
"federation"
];
compress = true; compress = true;
} }
]; ];

View File

@@ -1,21 +0,0 @@
{ 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;
};
}

View File

@@ -1,5 +1,4 @@
{ ... }: {...}: {
{
age.secrets = { age.secrets = {
# captcha = { # captcha = {
# file = ./secrets/matrix_captcha.age; # file = ./secrets/matrix_captcha.age;

View File

@@ -1,15 +1,9 @@
{ {config, ...}: {
config,
pkgs,
lib,
...
}:
{
users.users."starr" = { users.users."starr" = {
extraGroups = [ "transmission" ]; extraGroups = [ "transmission" ];
}; };
users.users.transmission = { users.users.transmission = {
isSystemUser = true; isSystemUser = true;
group = "transmission"; group = "transmission";
@@ -20,76 +14,56 @@
transmission.gid = 989; transmission.gid = 989;
}; };
# systemd.services = { virtualisation.oci-containers = let
# docker-transmission-network = { peerport = "63369";
# after = [ in {
# "network.target" backend = "docker";
# "docker-gluetun.service" containers = {
# "docker-transmission.service" gluetun = {
# ]; image = "qmcgaw/gluetun";
# wantedBy = [ environment = {
# "docker-gluetun.service" VPN_SERVICE_PROVIDER = "airvpn";
# "docker-transmission.service" VPN_TYPE = "wireguard";
# ]; # WIREGUARD_PRIVATE_KEY = "from agenix";
# serviceConfig = { # WIREGUARD_PRESHARED_KEY = "from agenix";
# ExecStart = "${lib.getExe pkgs.docker} network create docker-transmission; exit 0"; # WIREGUARD_ADDRESSES = "from agenix";
# }; # SERVER_COUNTRIES = "from agenix";
# }; FIREWALL_VPN_INPUT_PORTS = "13277,${peerport}";
# };
virtualisation.oci-containers =
let
peerport = "63369";
in
{
backend = "docker";
containers = {
gluetun = {
image = "qmcgaw/gluetun";
environment = {
VPN_SERVICE_PROVIDER = "airvpn";
VPN_TYPE = "wireguard";
# WIREGUARD_PRIVATE_KEY = "from agenix";
# WIREGUARD_PRESHARED_KEY = "from agenix";
# WIREGUARD_ADDRESSES = "from agenix";
# SERVER_COUNTRIES = "from agenix";
FIREWALL_VPN_INPUT_PORTS = "13277,${peerport}";
};
environmentFiles = [
config.age.secrets.airvpn-params.path
];
extraOptions = [
"--cap-add=NET_ADMIN"
"--device=/dev/net/tun"
# "--network=docker-transmission"
];
ports = [
"13277:13277"
"9091:13277"
"${peerport}:${peerport}"
"${peerport}:${peerport}/udp"
];
}; };
transmission = { environmentFiles = [
image = "docker.io/linuxserver/transmission:latest"; config.age.secrets.airvpn-params.path
volumes = [ ];
"/etc/transmission:/config" extraOptions = [
"/etc/localtime:/etc/localtime:ro" "--cap-add=NET_ADMIN"
"/mnt/mediacenter/torrents:/mnt/mediacenter/torrents" "--device=/dev/net/tun"
"/mnt/data/transmission_downloads:/mnt/data/transmission_downloads" ];
]; ports = [
dependsOn = [ "13277:13277"
"gluetun" "9091:13277"
]; "${peerport}:${peerport}"
extraOptions = [ "${peerport}:${peerport}/udp"
"--network=container:gluetun" ];
]; };
environment = { transmission = {
PUID = toString config.users.users.transmission.uid; image = "docker.io/linuxserver/transmission:latest";
GUID = toString config.users.groups.transmission.gid; volumes = [
PEERPORT = peerport; "/etc/transmission:/config"
}; "/etc/localtime:/etc/localtime:ro"
"/mnt/mediacenter/torrents:/mnt/mediacenter/torrents"
"/mnt/data/transmission_downloads:/mnt/data/transmission_downloads"
];
dependsOn = [
"gluetun"
];
extraOptions = [
"--network=container:gluetun"
];
environment = {
PUID = toString config.users.users.transmission.uid;
GUID = toString config.users.groups.transmission.gid;
PEERPORT = peerport;
}; };
}; };
}; };
};
} }

View File

@@ -2,26 +2,20 @@
# 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 [
# ./striped ./nginx.nix
# ./cybercoffee # ./striped
./ollama.nix # ./cybercoffee
./minecraft.nix ./ollama.nix
./nix-serve.nix ./minecraft.nix
]; # ./shares.nix
];
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@@ -35,7 +29,7 @@ in
# nameservers = [ "10.0.0.4" ]; # nameservers = [ "10.0.0.4" ];
# 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 ];
}; };
@@ -43,23 +37,18 @@ in
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.settings.experimental-features = [ "nix-command" "flakes" ];
"nix-command"
"flakes"
];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
users.users.n100 = { users.users.n100 = {
@@ -68,19 +57,16 @@ in
packages = with pkgs; [ packages = with pkgs; [
]; ];
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
];
}; };
users.users.root = { users.users.root = {
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos" ];
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKsu+4S+BHmypQTq2IR9y+ihvbF7sXbBznKtIjVAeHJ1 shobu@nixos"
];
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
lunarvim lunarvim
wget wget
httpie httpie
tmux tmux
@@ -126,3 +112,4 @@ in
system.stateVersion = "24.11"; # Did you read the comment? system.stateVersion = "24.11"; # Did you read the comment?
} }

View File

@@ -1,4 +1,4 @@
{ pkgs, ... }: {pkgs, ...}:
{ {
imports = [ imports = [
./halflife.nix ./halflife.nix

View File

@@ -1 +1,2 @@
{ ... }: { }
{...}: {}

View File

@@ -12,24 +12,23 @@
}; };
# Flake outputs # Flake outputs
outputs = outputs = inputs@{
inputs@{ self,
self, nixpkgs,
nixpkgs, nix-minecraft,
nix-minecraft, shoblog-front,
shoblog-front, striped-front,
striped-front, striped-back,
striped-back, ...
... }:
}: {
{ nixosConfigurations.n100 = nixpkgs.lib.nixosSystem {
nixosConfigurations.n100 = nixpkgs.lib.nixosSystem { system = "x86_64-linux";
system = "x86_64-linux"; specialArgs = { inherit inputs; };
specialArgs = { inherit inputs; }; modules = [
modules = [ ./configuration.nix
./configuration.nix ./hardware-configuration.nix
./hardware-configuration.nix ];
];
};
}; };
};
} }

View File

@@ -1,61 +1,47 @@
# 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 = [ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" "sdhci_pci" ];
"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 = [ options = [ "fmask=0077" "dmask=0077" ];
"fmask=0077" };
"dmask=0077"
];
};
swapDevices = [ ]; swapDevices = [ ];

View File

@@ -1,15 +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";
packHash = "sha256-+taYj4uroLNxM4Nia3n+5P1Y/g6dzE6Iq13TsZgk4mU="; packHash = "sha256-+taYj4uroLNxM4Nia3n+5P1Y/g6dzE6Iq13TsZgk4mU=";
}; };
reclamation = inputs.reclamation.packages.${pkgs.stdenv.system};
in in
{ {
imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ]; imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ];
@@ -20,28 +14,6 @@ in
eula = true; eula = true;
openFirewall = true; openFirewall = true;
servers.reclamation = {
enable = false;
package = pkgs.fabricServers.fabric;
symlinks = {
"mods" = "${reclamation.modpack}/mods";
"FTBLang" = "${reclamation.modpack}/FTBLang";
"defaultconfigs" = "${reclamation.modpack}/defaultconfigs";
"ressourcepacks" = "${reclamation.modpack}/ressourcepacks";
"config" = "${reclamation.modpack}/config";
"kubejs" = "${reclamation.modpack}/kubejs";
"patchouli_books" = "${reclamation.modpack}/patchouli_books";
"server.dat" = "${reclamation.modpack}/server.dat";
};
serverProperties = {
server-port = 43001;
motd = "all hail the gorgon v3.14";
allow-flight = true;
};
};
servers.testing-grounds = { servers.testing-grounds = {
enable = true; enable = true;

View File

@@ -1,132 +1,124 @@
{ inputs, ... }: {inputs, ...}:
let 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 = [ networking.firewall.allowedTCPPorts = [ 80 443 8448 ];
80
443
8448
];
services.nginx = { services.nginx = {
enable = true; enable = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
virtualHosts = virtualHosts =
let let
mkStarr = host: port: { mkStarr = host: port: {
"${host}" = { "${host}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://${sin-address}:${port}"; proxyPass = "http://${sin-address}:${port}";
proxyWebsockets = true; proxyWebsockets = true;
extraConfig = '' extraConfig = ''
proxy_ssl_server_name on; proxy_ssl_server_name on;
proxy_read_timeout 4800s; proxy_read_timeout 4800s;
''; '';
}; };
};
};
in
(
mkStarr "jellyfin.shobu.fr" "8096"
// mkStarr "radarr.shobu.fr" "7878"
// mkStarr "sonarr.shobu.fr" "8989"
// mkStarr "prowlarr.shobu.fr" "9696"
// mkStarr "bazarr.shobu.fr" "6767"
// mkStarr "jellyseerr.shobu.fr" "5055"
// mkStarr "fileshelter.shobu.fr" "5091"
// mkStarr "lidarr.shobu.fr" "8686"
// mkStarr "transmission.shobu.fr" "9091"
// mkStarr "zimablade-admin.shobu.fr" "61208"
// {
"shobu.fr" = {
enableACME = true;
forceSSL = true;
root = "${inputs.shoblog-front.packages.x86_64-linux.default}/dist";
};
"data.shobu.fr" = {
enableACME = true;
forceSSL = true;
root = "/mnt/shares/data";
};
"bddtrans.shobu.fr" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://${sin-address}:8001";
extraConfig = ''
proxy_ssl_server_name on;
'';
}; };
}; };
in "bddtrans-api.shobu.fr" = {
( enableACME = true;
mkStarr "jellyfin.shobu.fr" "8096" forceSSL = true;
// mkStarr "radarr.shobu.fr" "7878"
// mkStarr "sonarr.shobu.fr" "8989"
// mkStarr "prowlarr.shobu.fr" "9696"
// mkStarr "bazarr.shobu.fr" "6767"
// mkStarr "jellyseerr.shobu.fr" "5055"
// mkStarr "fileshelter.shobu.fr" "5091"
// mkStarr "lidarr.shobu.fr" "8686"
// mkStarr "transmission.shobu.fr" "9091"
// mkStarr "zimablade-admin.shobu.fr" "61208"
// {
"shobu.fr" = {
enableACME = true;
forceSSL = true;
root = "${inputs.shoblog-front.packages.x86_64-linux.default}/dist"; locations."/" = {
};
"data.shobu.fr" = {
enableACME = true;
forceSSL = true;
root = "/mnt/shares/data";
};
"bddtrans.shobu.fr" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://${sin-address}:8001";
extraConfig = ''
proxy_ssl_server_name on;
'';
};
};
"bddtrans-api.shobu.fr" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://${sin-address}:8000"; proxyPass = "http://${sin-address}:8000";
proxyWebsockets = true; proxyWebsockets = true;
extraConfig = '' extraConfig = ''
proxy_ssl_server_name on; proxy_ssl_server_name on;
''; '';
};
}; };
# "striped.shobu.fr" = { };
# enableACME = true; "striped.shobu.fr" = {
# forceSSL = true; enableACME = true;
forceSSL = true;
# root = "${striped-front.packages.x86_64-linux.default}/dist"; root = "${striped-front.packages.x86_64-linux.default}/dist";
# }; };
"dashboard.shobu.fr" = { "dashboard.shobu.fr" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://${sin-address}:8082"; proxyPass = "http://${sin-address}:8082";
};
}; };
"git.shobu.fr" = { };
enableACME = true; "git.shobu.fr" = {
forceSSL = true; enableACME = true;
forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://${sin-address}:3000"; proxyPass = "http://${sin-address}:3000";
};
}; };
"files.shobu.fr" = { };
enableACME = true; "files.shobu.fr" = {
forceSSL = true; enableACME = true;
forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://${sin-address}:8086"; proxyPass = "http://${sin-address}:8086";
extraConfig = ''
proxy_set_header X-Real-IP $remote_addr;
'';
};
}; };
# "matrix.shobu.fr" = { };
# forceSSL = true; # "matrix.shobu.fr" = {
# enableACME = true; # forceSSL = true;
# locations."/".extraConfig = '' # enableACME = true;
# return 404; # locations."/".extraConfig = ''
# ''; # return 404;
# locations."/_matrix".proxyPass = "http://${sin-address}:8008"; # '';
# locations."/_synapse/client".proxyPass = "http://${sin-address}:8008"; # locations."/_matrix".proxyPass = "http://${sin-address}:8008";
# locations."/.well-known/matrix/server".proxyPass = "http://${sin-address}:8008/.well-known/matrix/server"; # locations."/_synapse/client".proxyPass = "http://${sin-address}:8008";
# }; # locations."/.well-known/matrix/server".proxyPass = "http://${sin-address}:8008/.well-known/matrix/server";
} # };
); }
);
}; };
security.acme = { security.acme = {

View File

@@ -1,5 +1,4 @@
{ inputs, ... }: {inputs, ...}: {
{
# virtualisation.docker = { # virtualisation.docker = {
# enable = true; # enable = true;
# storageDriver = "btrfs"; # storageDriver = "btrfs";

View File

@@ -1,5 +1,4 @@
{ ... }: {...}: let
let
sin-address = "192.168.1.14"; sin-address = "192.168.1.14";
in in
{ {

View File

@@ -1,12 +1,11 @@
{ 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
]; ];
services.striped-back-api = { services.striped-back-api = {
enable = true; enable = true;
@@ -18,7 +17,7 @@ in
socket.enable = true; socket.enable = true;
settings.django = { settings.django = {
allowed-hosts = [ "striped-api.shobu.fr" ]; allowed-hosts = ["striped-api.shobu.fr"];
debug = true; debug = true;
databases = { databases = {
default = { default = {

View File

@@ -1,5 +1,4 @@
{ striped-back, striped-front, ... }: {striped-back, striped-front, ...}:{
{
imports = [ imports = [
./back.nix ./back.nix
]; ];

View File

@@ -1,8 +1,6 @@
{ lib, ... }: {lib, ...}: let
let
ssh_port = 24658; ssh_port = 24658;
in in {
{
services = { services = {
gitea = { gitea = {
enable = true; enable = true;
@@ -18,7 +16,7 @@ in
}; };
actions = { actions = {
ENABLED = true; ENABLED = true;
}; };
}; };
}; };
}; };

View File

@@ -1,56 +1,12 @@
{ {nodes, ...}:let
nodes,
inputs,
pkgs,
...
}:
let
sin-address = "192.168.1.14"; sin-address = "192.168.1.14";
unstable = import inputs.unstable { system = pkgs.system; }; in{
in
{
imports = [ imports = [
./virtualisation.nix ./virtualisation.nix
]; ];
networking.nat.forwardPorts = [ networking.nat.forwardPorts = [{
{ 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"; }];
}
];
services.gitea-actions-runner.package = unstable.gitea-actions-runner;
# services.gitea-actions-runner.instances = {
# "gitea.shobu.fr-runner" = {
# enable = true;
# name = "gitea.shobu.fr-runner";
# url = nodes.sin.config.services.gitea.settings.server.ROOT_URL;
# token = "uEDPBW6Z9oItAKRtloVwis0LkPbD4OmV2w5esOhW";
# labels = [
# "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
# ];
# settings = {
# cache = {
# # Enable cache server to use actions/cache.
# enabled = true;
# # The directory to store the cache data.
# # If it's empty, the cache data will be stored in $HOME/.cache/actcache.
# dir = "";
# # The host of the cache server.
# # It's not for the address to listen, but the address to connect from job containers.
# # So 0.0.0.0 is a bad choice, leave it empty to detect automatically.
# host = "";
# # The port of the cache server.
# # 0 means to use a random available port.
# port = 0;
# # The external cache server URL. Valid only when enable is true.
# # If it's specified, act_runner will use this URL as the ACTIONS_CACHE_URL rather than start a server by itself.
# # The URL should generally end with "/".
# external_server = "";
# };
# };
# };
# };
} }

View File

@@ -1,5 +1,4 @@
{ nodes, pkgs, ... }: {nodes, pkgs, ...}: {
{
systemd.sockets.podman.socketConfig.Symlinks = [ systemd.sockets.podman.socketConfig.Symlinks = [
"/run/docker.sock" "/run/docker.sock"
]; ];
@@ -16,36 +15,32 @@
}; };
}; };
virtualisation.oci-containers.containers = virtualisation.oci-containers.containers = let
let runner_config = pkgs.writeTextFile {
runner_config = pkgs.writeTextFile { name = "config.yml";
name = "config.yml"; text = ''
text = ''
container: container:
network: "host" network: "host"
valid_volumes:
- "/var/nix/hosted-store"
''; '';
};
in
{
gitea-runner = {
image = "gitea/act_runner@sha256:8477d5b61b655caad4449888bae39f1f34bebd27db56cb15a62dccb3dcf3a944";
autoStart = true;
# capabilities = {
# NET_RAW = true;
# };
environment = {
GITEA_INSTANCE_URL = nodes.sin.config.services.gitea.settings.server.ROOT_URL;
GITEA_RUNNER_REGISTRATION_TOKEN = "uEDPBW6Z9oItAKRtloVwis0LkPbD4OmV2w5esOhW";
CONFIG_FILE = "/config.yml";
};
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
"${runner_config}:/config.yml:ro"
];
};
}; };
in {
gitea-runner = {
image = "gitea/act_runner@sha256:8477d5b61b655caad4449888bae39f1f34bebd27db56cb15a62dccb3dcf3a944";
autoStart = true;
# capabilities = {
# NET_RAW = true;
# };
environment = {
GITEA_INSTANCE_URL = nodes.sin.config.services.gitea.settings.server.ROOT_URL;
GITEA_RUNNER_REGISTRATION_TOKEN = "uEDPBW6Z9oItAKRtloVwis0LkPbD4OmV2w5esOhW";
CONFIG_FILE = "/config.yml";
};
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
"${runner_config}:/config.yml:ro"
];
};
};
} }

View File

@@ -1,11 +0,0 @@
#!/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