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

View file

@ -14,11 +14,19 @@
./minecraft.nix
./nfs.nix
./radicale.nix
./syncthing.nix
../../modules/common
../../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 = [
./hardware-configuration.nix
#./disko.nix
./syncthing.nix
../../modules/common
../../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
./optimise.nix
./sops.nix
./syncthing.nix
];
networking = {

View file

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