Compare commits

...

5 commits

Author SHA1 Message Date
willifan
a94fee1cd2 update flake 2024-12-22 21:57:54 +01:00
willifan
74464735ae added prusa mini dfu udev rule 2024-12-15 18:51:09 +01:00
willifan
a3ab33a34a modularized syncthing 2024-12-15 17:45:29 +01:00
willifan
272bcb75f4 added syncthing as module 2024-12-15 16:05:06 +01:00
willifan
121c86247a remove unnecessary script directory 2024-12-15 15:23:51 +01:00
12 changed files with 98 additions and 236 deletions

72
flake.lock generated
View file

@ -94,11 +94,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733168902, "lastModified": 1734701201,
"narHash": "sha256-8dupm9GfK+BowGdQd7EHK5V61nneLfr9xR6sc5vtDi0=", "narHash": "sha256-hk0roBX10j/hospoWIJIJj3i2skd7Oml6yKQBx7mTFk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "785c1e02c7e465375df971949b8dcbde9ec362e5", "rev": "2ee76c861af3b895b3b104bae04777b61397485b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -230,11 +230,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733318908, "lastModified": 1734797603,
"narHash": "sha256-SVQVsbafSM1dJ4fpgyBqLZ+Lft+jcQuMtEL3lQWx2Sk=", "narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "6f4e2a2112050951a314d2733a994fbab94864c6", "rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -289,11 +289,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733873195, "lastModified": 1734893333,
"narHash": "sha256-dTosiZ3sZ/NKoLKQ++v8nZdEHya0eTNEsaizNp+MUPM=", "narHash": "sha256-0Ft7iTkl3UWAix72teY5nflYQD7GE0KvIiT+ox4wkB8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f26aa4b76fb7606127032d33ac73d7d507d82758", "rev": "1f74238a4c8e534a1b6be72cb5153043071ffd17",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -310,11 +310,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733484277, "lastModified": 1734862405,
"narHash": "sha256-i5ay20XsvpW91N4URET/nOc0VQWOAd4c4vbqYtcH8Rc=", "narHash": "sha256-bXZJvUMJ2A6sIpYcCUAGjYCD5UDzmpmQCdmJSkPhleU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d00c6f6d0ad16d598bf7e2956f52c1d9d5de3c3a", "rev": "cb27edb5221d2f2920a03155f8becc502cf60e35",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -380,11 +380,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733859890, "lastModified": 1734725857,
"narHash": "sha256-HnA6z2l2W38TJBarvWCcxjTjcpz7JrDj2u2umjYFcEo=", "narHash": "sha256-bivlV9l/UjMtTfz/CZaoNJ5RfH2Lre4P9Ds64conoUQ=",
"owner": "Jovian-Experiments", "owner": "Jovian-Experiments",
"repo": "Jovian-NixOS", "repo": "Jovian-NixOS",
"rev": "77ffd839fd9d60d139dc4a2ad6b6d526f4ad5a17", "rev": "dbae2fd6adaf34c947d310bec08deac7c4ed265b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -438,11 +438,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1733861262, "lastModified": 1734862644,
"narHash": "sha256-+jjPup/ByS0LEVIrBbt7FnGugJgLeG9oc+ivFASYn2U=", "narHash": "sha256-04xesW7HITdF5WUmNM39WD4tkEERk3Ez2W1nNvdIvIw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "cf737e2eba82b603f54f71b10cb8fd09d22ce3f5", "rev": "e8516a23524cc9083f5a02a8d64d14770e4c7c09",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -453,11 +453,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1733759999, "lastModified": 1734649271,
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=", "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56", "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -482,11 +482,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1733847310, "lastModified": 1734880727,
"narHash": "sha256-VHzWuZYK/m5OFXzAczrjnI7vH6knj0sfLnziRVDqgFE=", "narHash": "sha256-bQfaaYoH8kSdw2UWb8RLZoa/2jPvDjaw87nvj+pO5lE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "b752606681ded3f69e99ed568c7075b3578dce48", "rev": "450cccf472f40ae8e3b92eec9e5f4b071693ac85",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -505,11 +505,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733411491, "lastModified": 1733773348,
"narHash": "sha256-315rJ7O9cOllPDaFscnJhcMleORHbxon0Kq9LAKJ5p4=", "narHash": "sha256-Y47y+LesOCkJaLvj+dI/Oa6FAKj/T9sKVKDXLNsViPw=",
"owner": "NuschtOS", "owner": "NuschtOS",
"repo": "search", "repo": "search",
"rev": "68e9fad70d95d08156cf10a030bd39487bed8ffe", "rev": "3051be7f403bff1d1d380e4612f0c70675b44fc9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -538,11 +538,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733785344, "lastModified": 1734546875,
"narHash": "sha256-pm4cfEcPXripE36PYCl0A2Tu5ruwHEvTee+HzNk+SQE=", "narHash": "sha256-6OvJbqQ6qPpNw3CA+W8Myo5aaLhIJY/nNFDk3zMXLfM=",
"owner": "mic92", "owner": "mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "a80af8929781b5fe92ddb8ae52e9027fae780d2a", "rev": "ed091321f4dd88afc28b5b4456e0a15bd8374b4d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -570,11 +570,11 @@
"tinted-tmux": "tinted-tmux" "tinted-tmux": "tinted-tmux"
}, },
"locked": { "locked": {
"lastModified": 1733858997, "lastModified": 1734885904,
"narHash": "sha256-PMZdRUZQlouWgHFCFW8ANDFL6fUjZ67KAEaqRXwRwvc=", "narHash": "sha256-NxA4JnLuXyle2/nUKDbW8vORwSd+Z20limIl7DhlZbs=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "bc25f3d69d3bb54548b772d7c2771e65cc37dc10", "rev": "4d87b96ceca38532f39c1b7efd8a9235bfcee3d6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -671,11 +671,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733440889, "lastModified": 1734704479,
"narHash": "sha256-qKL3vjO+IXFQ0nTinFDqNq/sbbnnS5bMI1y0xX215fU=", "narHash": "sha256-MMi74+WckoyEWBRcg/oaGRvXC9BVVxDZNRMpL+72wBI=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "50862ba6a8a0255b87377b9d2d4565e96f29b410", "rev": "65712f5af67234dad91a5a4baee986a8b62dbf8f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -14,11 +14,19 @@
./minecraft.nix ./minecraft.nix
./nfs.nix ./nfs.nix
./radicale.nix ./radicale.nix
./syncthing.nix
../../modules/common ../../modules/common
../../modules/server ../../modules/server
]; ];
common.syncthing = {
enable = true;
devices = {
Lenni = { id = "XS6NR2Q-DHVB5G4-P43CHWR-TVBIY5A-FCIS7CU-S5UVNZA-5YPJYST-2EO2GAG"; };
Puenktchen = { id = "VP3YVIM-JNSZTXV-7AS7FA2-3W5QKH6-XOWXX7N-STUR4JR-PR6SPCV-HJZMAAN"; };
Damin = { id = "HAGKFGG-EMCPKHG-Y7V2ACJ-DJVAIIA-A6TNGTQ-VWPB3F5-PES673W-W2YBJAD"; };
};
};
} }

View file

@ -1,55 +0,0 @@
{ ... }:
{
services.syncthing = {
enable = true;
dataDir = "/mnt/data/services/syncthing/data";
configDir = "/mnt/data/services/syncthing/config";
overrideDevices = true;
overrideFolders = true;
openDefaultPorts = true;
guiAddress = "0.0.0.0:8384";
settings = {
gui = {
user = "willifan";
password = "temppassword";
};
devices = {
Lenni = { id = "XS6NR2Q-DHVB5G4-P43CHWR-TVBIY5A-FCIS7CU-S5UVNZA-5YPJYST-2EO2GAG"; };
Puenktchen = { id = "VP3YVIM-JNSZTXV-7AS7FA2-3W5QKH6-XOWXX7N-STUR4JR-PR6SPCV-HJZMAAN"; };
Damin = { id = "HAGKFGG-EMCPKHG-Y7V2ACJ-DJVAIIA-A6TNGTQ-VWPB3F5-PES673W-W2YBJAD"; };
};
folders = {
"Documents" = {
id = "jtl6g-qjmwo";
path = "/mnt/data/services/syncthing/data/Documents";
devices = [ "Lenni" "Puenktchen" ];
};
"Enpass" = {
id = "ciksm-xsw4m";
path = "/mnt/data/services/syncthing/data/Enpass";
devices = [ "Lenni" "Puenktchen" "Damin" ];
};
"Pictures" = {
id = "po4qj-q9t0t";
path = "/mnt/data/services/syncthing/data/Pictures";
devices = [ "Lenni" "Puenktchen" ];
};
"Videos" = {
id = "4wqf5-xasng";
path = "/mnt/data/services/syncthing/data/Videos";
devices = [ "Lenni" "Puenktchen" ];
};
"Notes" = {
id = "oc61n-iewgj";
path = "/mnt/data/services/syncthing/data/Notes";
devices = [ "Lenni" "Puenktchen" ];
};
"Music" = {
id = "xxh8a-3y2tq";
path = "/mnt/data/services/syncthing/data/Music";
devices = [ "Lenni" "Puenktchen" ];
};
};
};
};
}

View file

@ -3,9 +3,16 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
#./disko.nix #./disko.nix
./syncthing.nix
../../modules/common ../../modules/common
../../modules/desktop ../../modules/desktop
]; ];
common.syncthing = {
enable = true;
devices = {
Anton = { id = "WCDBADD-UPKCACI-X2YJOIO-5QC44PL-DBCR6TS-ADVQV33-HSMF32O-FOKMKAU"; };
};
};
} }

View file

@ -1,52 +0,0 @@
{ ... }:
{
services.syncthing = {
enable = true;
user = "willifan";
dataDir = "/mnt/data";
configDir = "/mnt/data/.config/syncthing";
overrideDevices = true;
overrideFolders = true;
settings = {
gui = {
user = "willifan";
password = "temppassword";
};
devices = {
Anton = { id = "WCDBADD-UPKCACI-X2YJOIO-5QC44PL-DBCR6TS-ADVQV33-HSMF32O-FOKMKAU"; };
};
folders = {
"Documents" = {
id = "jtl6g-qjmwo";
path = "/mnt/data/Documents";
devices = [ "Anton" ];
};
"Enpass" = {
id = "ciksm-xsw4m";
path = "/mnt/data/Enpass";
devices = [ "Anton" ];
};
"Pictures" = {
id = "po4qj-q9t0t";
path = "/mnt/data/Pictures";
devices = [ "Anton" ];
};
"Videos" = {
id = "4wqf5-xasng";
path = "/mnt/data/Videos";
devices = [ "Anton" ];
};
"Notes" = {
id = "oc61n-iewgj";
path = "/mnt/data/Notes";
devices = [ "Anton" ];
};
"Music" = {
id = "xxh8a-3y2tq";
path = "/mnt/data/Music";
devices = [ "Anton" ];
};
};
};
};
}

View file

@ -9,4 +9,11 @@
]; ];
common.syncthing = {
enable = true;
devices = {
Anton = { id = "WCDBADD-UPKCACI-X2YJOIO-5QC44PL-DBCR6TS-ADVQV33-HSMF32O-FOKMKAU"; };
};
};
} }

View file

@ -1,52 +0,0 @@
{ ... }:
{
services.syncthing = {
enable = true;
user = "willifan";
dataDir = "/mnt/data";
configDir = "/mnt/data/.config/syncthing";
overrideDevices = true;
overrideFolders = true;
settings = {
gui = {
user = "willifan";
password = "temppassword";
};
devices = {
Anton = { id = "WCDBADD-UPKCACI-X2YJOIO-5QC44PL-DBCR6TS-ADVQV33-HSMF32O-FOKMKAU"; };
};
folders = {
"Documents" = {
id = "jtl6g-qjmwo";
path = "/mnt/data/Documents";
devices = [ "Anton" ];
};
"Enpass" = {
id = "ciksm-xsw4m";
path = "/mnt/data/Enpass";
devices = [ "Anton" ];
};
"Pictures" = {
id = "po4qj-q9t0t";
path = "/mnt/data/Pictures";
devices = [ "Anton" ];
};
"Videos" = {
id = "4wqf5-xasng";
path = "/mnt/data/Videos";
devices = [ "Anton" ];
};
"Notes" = {
id = "oc61n-iewgj";
path = "/mnt/data/Notes";
devices = [ "Anton" ];
};
"Music" = {
id = "xxh8a-3y2tq";
path = "/mnt/data/Music";
devices = [ "Anton" ];
};
};
};
};
}

View file

@ -7,6 +7,7 @@
./mimetype.nix ./mimetype.nix
./optimise.nix ./optimise.nix
./sops.nix ./sops.nix
./syncthing.nix
]; ];
networking = { networking = {

View file

@ -1,68 +1,68 @@
{ lib, config, ... }: { lib, types, config, ... }:
let
deviceList = builtins.attrNames config.common.syncthing.devices;
in
{ {
options = { options = {
common.syncthing = {
syncthing.devices = lib.mkOption { enable = lib.mkEnableOption "enable syncthing";
default = { };
type = lib.types.attrsOf (lib.types.submodule {
options = {
id = lib.mkOption { devices = lib.mkOption {
type = lib.types.str; type = lib.types.attrsOf (lib.types.submodule {
default = null;
}; options.id = lib.mkOption { type = lib.types.str; };
}; });
});
};
}; };
}; };
services.syncthing = { config.services.syncthing = lib.mkIf config.common.syncthing.enable {
enable = true; enable = lib.mkDefault true;
user = "willifan"; user = lib.mkDefault "willifan";
dataDir = "/mnt/data"; dataDir = lib.mkDefault "/mnt/data";
configDir = "/mnt/data/.config/syncthing"; configDir = lib.mkDefault "/mnt/data/.config/syncthing";
overrideDevices = true; overrideDevices = lib.mkDefault true;
overrideFolders = true; overrideFolders = lib.mkDefault true;
settings = { settings = {
gui = { gui = {
user = "willifan"; user = lib.mkDefault "willifan";
password = "temppassword"; password = lib.mkDefault "temppassword";
}; };
devices = { devices = config.common.syncthing.devices;
Anton = { id = "WCDBADD-UPKCACI-X2YJOIO-5QC44PL-DBCR6TS-ADVQV33-HSMF32O-FOKMKAU"; }; folders = lib.mkDefault {
};
folders = {
"Documents" = { "Documents" = {
id = "jtl6g-qjmwo"; id = "jtl6g-qjmwo";
path = "/mnt/data/Documents"; path = "/mnt/data/Documents";
devices = [ "Anton" ]; devices = deviceList;
}; };
"Enpass" = { "Enpass" = lib.mkDefault {
id = "ciksm-xsw4m"; id = "ciksm-xsw4m";
path = "/mnt/data/Enpass"; path = "/mnt/data/Enpass";
devices = [ "Anton" ]; devices = deviceList;
}; };
"Pictures" = { "Pictures" = lib.mkDefault {
id = "po4qj-q9t0t"; id = "po4qj-q9t0t";
path = "/mnt/data/Pictures"; path = "/mnt/data/Pictures";
devices = [ "Anton" ]; devices = deviceList;
}; };
"Videos" = { "Videos" = lib.mkDefault {
id = "4wqf5-xasng"; id = "4wqf5-xasng";
path = "/mnt/data/Videos"; path = "/mnt/data/Videos";
devices = [ "Anton" ]; devices = deviceList;
}; };
"Notes" = { "Notes" = lib.mkDefault {
id = "oc61n-iewgj"; id = "oc61n-iewgj";
path = "/mnt/data/Notes"; path = "/mnt/data/Notes";
devices = [ "Anton" ]; devices = deviceList;
}; };
"Music" = { "Music" = lib.mkDefault {
id = "xxh8a-3y2tq"; id = "xxh8a-3y2tq";
path = "/mnt/data/Music"; path = "/mnt/data/Music";
devices = [ "Anton" ]; devices = deviceList;
}; };
}; };
}; };

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash

View file

@ -1,2 +0,0 @@
#!/usr/bin/env bash

View file

@ -2,6 +2,8 @@
{ {
services.udev.extraRules = '' services.udev.extraRules = ''
ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="614e", MODE="660", GROUP="plugdev", TAG+="uaccess"
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="660", GROUP="plugdev", TAG+="uaccess"
# Copy this file to /etc/udev/rules.d/ # Copy this file to /etc/udev/rules.d/
# If rules fail to reload automatically, you can refresh udev rules # If rules fail to reload automatically, you can refresh udev rules