Compare commits
10 commits
master
...
deploy-com
Author | SHA1 | Date | |
---|---|---|---|
5220cceda8 | |||
133e70967f | |||
c3934c2b56 | |||
3059bdce30 | |||
cc9d6c362d | |||
49520149ab | |||
ade0694d14 | |||
872849c875 | |||
2b2aa11c52 | |||
9b9d923a25 |
15 changed files with 188 additions and 59 deletions
60
.github/workflows/eval.yaml
vendored
Normal file
60
.github/workflows/eval.yaml
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
name: Eval NixOS Configurations
|
||||||
|
|
||||||
|
on:
|
||||||
|
check_suite:
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: deploy
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v25
|
||||||
|
with:
|
||||||
|
extra_nix_conf: |
|
||||||
|
extra-trusted-public-keys = cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
|
||||||
|
extra-substituters = https://cache.garnix.io
|
||||||
|
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config --global user.name "GitHub Actions Bot"
|
||||||
|
git config --global user.email "actions@github.com"
|
||||||
|
|
||||||
|
- name: Process Configurations
|
||||||
|
run: |
|
||||||
|
git checkout -b deploy-comin-eval
|
||||||
|
mkdir -p eval
|
||||||
|
hosts=$(nix flake show --json | jq -r '.nixosConfigurations | keys[]')
|
||||||
|
echo "Found hosts: $hosts"
|
||||||
|
|
||||||
|
failed_hosts=""
|
||||||
|
for host in $hosts; do
|
||||||
|
echo "Eval derivation for $host"
|
||||||
|
if ! nix derivation show ".#nixosConfigurations.$host.config.system.build.toplevel" > "eval/$host.json"; then
|
||||||
|
echo "❌ Failed to evaluate $host"
|
||||||
|
failed_hosts+="$host "
|
||||||
|
rm "eval/$host.json"
|
||||||
|
else
|
||||||
|
echo "✅ Successfully evaluated $host"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Failed hosts: $failed_hosts"
|
||||||
|
|
||||||
|
git add eval/
|
||||||
|
git commit -m "Update deployment configurations for all hosts"
|
||||||
|
|
||||||
|
git push -f origin deploy-comin-eval
|
||||||
|
|
||||||
|
# After success, reset deploy-comin to new deploy
|
||||||
|
git checkout -b deploy-comin
|
||||||
|
git reset --hard deploy
|
||||||
|
git push -f origin deploy-comin
|
25
flake.lock
generated
25
flake.lock
generated
|
@ -39,6 +39,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"comin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1734693645,
|
||||||
|
"narHash": "sha256-Vw3YpuQxwBse5JiTGBH5MSPmqXOXFI4ROs7IF3tRc7k=",
|
||||||
|
"owner": "xinyangli",
|
||||||
|
"repo": "comin",
|
||||||
|
"rev": "c8a66bbd129e88ad916cac59f1ad9f45d39b3190",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "xinyangli",
|
||||||
|
"repo": "comin",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"devshell": {
|
"devshell": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -382,11 +402,11 @@
|
||||||
"rev": "a3709a89797ea094f82d38edeb4a538c07c8c3fa",
|
"rev": "a3709a89797ea094f82d38edeb4a538c07c8c3fa",
|
||||||
"revCount": 20,
|
"revCount": 20,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.xinyang.life/xin/nixvim"
|
"url": "https://git.xiny.li/xin/nixvim"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.xinyang.life/xin/nixvim"
|
"url": "https://git.xiny.li/xin/nixvim"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nix-darwin": {
|
"nix-darwin": {
|
||||||
|
@ -642,6 +662,7 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"catppuccin": "catppuccin",
|
"catppuccin": "catppuccin",
|
||||||
"colmena": "colmena",
|
"colmena": "colmena",
|
||||||
|
"comin": "comin",
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_2",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
|
|
25
flake.nix
25
flake.nix
|
@ -43,7 +43,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
my-nixvim = {
|
my-nixvim = {
|
||||||
url = "git+https://git.xinyang.life/xin/nixvim";
|
url = "git+https://git.xiny.li/xin/nixvim";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -55,6 +55,11 @@
|
||||||
url = "github:nix-community/disko";
|
url = "github:nix-community/disko";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
comin = {
|
||||||
|
url = "github:xinyangli/comin";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
@ -72,6 +77,7 @@
|
||||||
colmena,
|
colmena,
|
||||||
nix-index-database,
|
nix-index-database,
|
||||||
disko,
|
disko,
|
||||||
|
comin,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
@ -107,6 +113,7 @@
|
||||||
sharedNixosModules = [
|
sharedNixosModules = [
|
||||||
self.nixosModules.default
|
self.nixosModules.default
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
|
comin.nixosModules.comin
|
||||||
];
|
];
|
||||||
nodeNixosModules = {
|
nodeNixosModules = {
|
||||||
calcite = [
|
calcite = [
|
||||||
|
@ -286,16 +293,22 @@
|
||||||
{
|
{
|
||||||
imports = nodeNixosModules.biotite ++ sharedColmenaModules;
|
imports = nodeNixosModules.biotite ++ sharedColmenaModules;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
osmium =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
deployment = {
|
||||||
|
targetHost = "osmium.coho-tet.ts.net";
|
||||||
|
buildOnTarget = false;
|
||||||
|
};
|
||||||
|
imports = nodeNixosModules.osmium ++ sharedColmenaModules;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
calcite = mkNixos {
|
calcite = mkNixos {
|
||||||
hostname = "calcite";
|
hostname = "calcite";
|
||||||
};
|
};
|
||||||
|
|
||||||
osmium = mkNixos {
|
|
||||||
hostname = "osmium";
|
|
||||||
};
|
|
||||||
} // self.colmenaHive.nodes;
|
} // self.colmenaHive.nodes;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -305,7 +318,7 @@
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
mkHomeConfiguration = user: host: {
|
mkHomeConfiguration = user: host: {
|
||||||
name = user;
|
name = "${user}-${host}";
|
||||||
value = home-manager.lib.homeManagerConfiguration {
|
value = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
|
|
|
@ -7,4 +7,4 @@ builds:
|
||||||
- homeConfigurations.aarch64-linux.*
|
- homeConfigurations.aarch64-linux.*
|
||||||
- darwinConfigurations.*
|
- darwinConfigurations.*
|
||||||
- nixosConfigurations.*
|
- nixosConfigurations.*
|
||||||
|
branch: deploy
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
xin = {
|
xin = {
|
||||||
calcite = import ./xin/calcite.nix;
|
calcite = import ./xin/calcite.nix;
|
||||||
|
gold = import ./xin/gold;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,10 +108,12 @@ in
|
||||||
|
|
||||||
xdg.systemDirs.data = [
|
xdg.systemDirs.data = [
|
||||||
"/usr/share"
|
"/usr/share"
|
||||||
"/var/lib/flatpak/exports/share"
|
|
||||||
"${homeDirectory}/.local/share/flatpak/exports/share"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
xdg.configFile."distrobox/distrobox.conf".text = ''
|
||||||
|
container_additional_volumes="/nix/store:/nix/store:ro /etc/profiles/per-user:/etc/profiles/per-user:ro"
|
||||||
|
'';
|
||||||
|
|
||||||
programs.man.generateCaches = false;
|
programs.man.generateCaches = false;
|
||||||
|
|
||||||
programs.atuin = {
|
programs.atuin = {
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
imports = [ ../common ];
|
|
||||||
|
|
||||||
home.username = "xin";
|
|
||||||
home.homeDirectory = "/home/xin";
|
|
||||||
home.stateVersion = "23.05";
|
|
||||||
|
|
||||||
# Let Home Manager install and manage itself.
|
|
||||||
programs.home-manager.enable = true;
|
|
||||||
|
|
||||||
accounts.email.accounts.gmail = {
|
|
||||||
primary = true;
|
|
||||||
address = "lixinyang411@gmail.com";
|
|
||||||
flavor = "gmail.com";
|
|
||||||
};
|
|
||||||
|
|
||||||
accounts.email.accounts.whu = {
|
|
||||||
address = "lixinyang411@whu.edu.cn";
|
|
||||||
};
|
|
||||||
|
|
||||||
accounts.email.accounts.foxmail = {
|
|
||||||
address = "lixinyang411@foxmail.com";
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -20,6 +20,7 @@ in
|
||||||
nix = {
|
nix = {
|
||||||
signing.enable = true;
|
signing.enable = true;
|
||||||
};
|
};
|
||||||
|
comin.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Bootloader.
|
# Bootloader.
|
||||||
|
@ -176,7 +177,7 @@ in
|
||||||
];
|
];
|
||||||
settings = {
|
settings = {
|
||||||
main = {
|
main = {
|
||||||
capslock = "overload(control, esc)";
|
leftcontrol = "overload(control, esc)";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
nix = {
|
nix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
comin.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
@ -38,7 +39,10 @@
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.virtiofsd ];
|
environment.systemPackages = [
|
||||||
|
pkgs.virtiofsd
|
||||||
|
pkgs.intel-gpu-tools
|
||||||
|
];
|
||||||
|
|
||||||
sops = {
|
sops = {
|
||||||
defaultSopsFile = ./secrets.yaml;
|
defaultSopsFile = ./secrets.yaml;
|
||||||
|
@ -94,15 +98,32 @@
|
||||||
options = "rw,nodev,nosuid";
|
options = "rw,nodev,nosuid";
|
||||||
wantedBy = [ "restic-rest-server.service" ];
|
wantedBy = [ "restic-rest-server.service" ];
|
||||||
}
|
}
|
||||||
|
# {
|
||||||
|
# what = "ocis";
|
||||||
|
# where = "/var/lib/ocis";
|
||||||
|
# type = "virtiofs";
|
||||||
|
# options = "rw,nodev,nosuid";
|
||||||
|
# wantedBy = [ "ocis.service" ];
|
||||||
|
# }
|
||||||
{
|
{
|
||||||
what = "ocis";
|
what = "media";
|
||||||
where = "/var/lib/ocis";
|
where = "/var/lib/jellyfin/media";
|
||||||
type = "virtiofs";
|
type = "virtiofs";
|
||||||
options = "rw,nodev,nosuid";
|
options = "rw,nodev,nosuid";
|
||||||
wantedBy = [ "ocis.service" ];
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
hardware.graphics = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
intel-media-driver
|
||||||
|
intel-vaapi-driver
|
||||||
|
vaapiVdpau
|
||||||
|
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
|
||||||
|
intel-media-sdk # QSV up to 11th gen
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
services.openssh.ports = [
|
services.openssh.ports = [
|
||||||
22
|
22
|
||||||
2222
|
2222
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
./restic.nix
|
./restic.nix
|
||||||
./media-download.nix
|
./media-download.nix
|
||||||
./immich.nix
|
./immich.nix
|
||||||
|
./jellyfin.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
15
machines/weilite/services/jellyfin.nix
Normal file
15
machines/weilite/services/jellyfin.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.jellyfin.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
jellyfin
|
||||||
|
jellyfin-web
|
||||||
|
jellyfin-ffmpeg
|
||||||
|
];
|
||||||
|
services.caddy.virtualHosts."https://weilite.coho-tet.ts.net:8920".extraConfig = ''
|
||||||
|
reverse_proxy 127.0.0.1:8096
|
||||||
|
'';
|
||||||
|
networking.firewall.allowedTCPPorts = [ 8920 ]; # allow on lan
|
||||||
|
users.users.jellyfin.extraGroups = [ "render" ];
|
||||||
|
}
|
|
@ -13,6 +13,10 @@
|
||||||
name = "Catppuccin-GTK-Dark";
|
name = "Catppuccin-GTK-Dark";
|
||||||
package = pkgs.magnetic-catppuccin-gtk;
|
package = pkgs.magnetic-catppuccin-gtk;
|
||||||
};
|
};
|
||||||
|
iconTheme = {
|
||||||
|
name = "Qogir";
|
||||||
|
package = pkgs.qogir-icon-theme;
|
||||||
|
};
|
||||||
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,8 +44,6 @@ in
|
||||||
modules-right = [
|
modules-right = [
|
||||||
"network#speed"
|
"network#speed"
|
||||||
"custom/separator"
|
"custom/separator"
|
||||||
"network#if"
|
|
||||||
"custom/separator"
|
|
||||||
"pulseaudio"
|
"pulseaudio"
|
||||||
"custom/separator"
|
"custom/separator"
|
||||||
"memory"
|
"memory"
|
||||||
|
@ -121,22 +119,6 @@ in
|
||||||
format = " {percentage}%";
|
format = " {percentage}%";
|
||||||
};
|
};
|
||||||
|
|
||||||
"network#if" = {
|
|
||||||
format = "{ifname}";
|
|
||||||
format-disconnected = "";
|
|
||||||
format-ethernet = "";
|
|
||||||
format-linked = "{ifname} (No IP) ";
|
|
||||||
format-wifi = "{icon}";
|
|
||||||
format-icons = [
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
""
|
|
||||||
];
|
|
||||||
interval = 10;
|
|
||||||
};
|
|
||||||
|
|
||||||
"network#speed" = {
|
"network#speed" = {
|
||||||
format = "{ifname}";
|
format = "{ifname}";
|
||||||
format-disconnected = "";
|
format-disconnected = "";
|
||||||
|
|
32
modules/nixos/common-settings/comin.nix
Normal file
32
modules/nixos/common-settings/comin.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib)
|
||||||
|
mkEnableOption
|
||||||
|
mkIf
|
||||||
|
;
|
||||||
|
|
||||||
|
cfg = config.commonSettings.comin;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.commonSettings.comin = {
|
||||||
|
enable = mkEnableOption "auto updater with comin";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
services.comin = mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
remotes = [
|
||||||
|
{
|
||||||
|
name = "origin";
|
||||||
|
url = "https://github.com/xinyangli/nixos-config.git";
|
||||||
|
branches.main.name = "deploy-comin";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
hostname = config.networking.hostName;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./common-settings/auth.nix
|
./common-settings/auth.nix
|
||||||
./common-settings/autoupgrade.nix
|
./common-settings/autoupgrade.nix
|
||||||
|
./common-settings/comin.nix
|
||||||
./common-settings/nix-conf.nix
|
./common-settings/nix-conf.nix
|
||||||
./common-settings/proxy-server.nix
|
./common-settings/proxy-server.nix
|
||||||
./common-settings/mainland.nix
|
./common-settings/mainland.nix
|
||||||
|
|
Loading…
Add table
Reference in a new issue