update syncthing id

This commit is contained in:
Kopatz
2024-06-24 10:01:15 +02:00
parent ec28c29b9f
commit 3d7b43c583
8 changed files with 76 additions and 20 deletions

View File

@@ -99,6 +99,7 @@
vars = import ./systems/userdata-default.nix vars = import ./systems/userdata-default.nix
// import ./systems/laptop/userdata.nix; // import ./systems/laptop/userdata.nix;
pkgsVersion = nixpkgs-unstable; pkgsVersion = nixpkgs-unstable;
home-manager-version = home-manager-unstable;
inherit nix-colors; inherit nix-colors;
}; };
modules = [ modules = [

View File

@@ -12,7 +12,10 @@
ld.enable = true; ld.enable = true;
settings.enable = true; settings.enable = true;
}; };
misc = { podman.enable = true; }; misc = {
podman.enable = true;
firejail.enable = true;
};
hardware = { hardware = {
firmware.enable = true; firmware.enable = true;
ssd.enable = true; ssd.enable = true;
@@ -34,4 +37,9 @@
shared.enable = true; shared.enable = true;
}; };
}; };
programs.firejail.wrappedBinaries = with pkgs;
let inherit (config.custom.misc.firejail) mk;
in lib.mkMerge [
(mk "Discord" { pkg = discord; })
];
} }

View File

@@ -4,6 +4,7 @@
./packages-list.nix ./packages-list.nix
./backup.nix ./backup.nix
./btrfs.nix ./btrfs.nix
./firejail.nix
./cli-tools.nix ./cli-tools.nix
./docker.nix ./docker.nix
./nftables.nix ./nftables.nix

28
modules/misc/firejail.nix Normal file
View File

@@ -0,0 +1,28 @@
{ lib, config, pkgs, ... }:
let cfg = config.custom.misc.firejail;
in {
options.custom.misc.firejail = {
enable = lib.mkEnableOption "Enables firejail";
package = lib.mkOption {
type = lib.types.package;
default = pkgs.firejail;
description = "Firejail package used";
readOnly = true; # is a constant from the upstream NixOS module for now
};
mk = lib.mkOption {
readOnly = true;
description = "Utility function to make a wrappedBinaries entry";
default = name:
{ pkg, profile ? name, bin ? name }: {
${bin} = {
executable = "${lib.getBin pkg}/bin/${bin}";
profile =
"${config.custom.misc.firejail.package}/etc/firejail/${profile}.profile";
};
};
};
};
config = lib.mkIf cfg.enable { programs.firejail.enable = true; };
}

View File

@@ -1,12 +1,9 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let basePath = "/synced";
basePath = "/synced"; in {
in systemd.tmpfiles.rules =
{ [ "d ${basePath} 0700 ${config.mainUser.name} users -" ];
systemd.tmpfiles.rules = [
"d ${basePath} 0700 ${config.mainUser.name} users -"
];
# check device id: syncthing cli --gui-address=/synced/gui-socket --gui-apikey=<key> show system # check device id: syncthing cli --gui-address=/synced/gui-socket --gui-apikey=<key> show system
environment.systemPackages = with pkgs; [ syncthing ]; environment.systemPackages = with pkgs; [ syncthing ];
@@ -27,46 +24,56 @@ in
devices = { devices = {
kop-pc = { kop-pc = {
id = "DZKIUS7-WCGTYEV-4OKVSZU-MIVL2NC-N45AKZL-ABT3VN2-I7RXUMF-RF4CYAU"; id =
"DZKIUS7-WCGTYEV-4OKVSZU-MIVL2NC-N45AKZL-ABT3VN2-I7RXUMF-RF4CYAU";
addresses = [ "tcp://192.168.0.11" ]; addresses = [ "tcp://192.168.0.11" ];
}; };
server = { server = {
id = "HZUUQEQ-JOKYHTU-AVFVC3U-7KUAXVC-QY3OJTF-HGU7RZ3-5HA5TOE-VT4FNQB"; id =
"HZUUQEQ-JOKYHTU-AVFVC3U-7KUAXVC-QY3OJTF-HGU7RZ3-5HA5TOE-VT4FNQB";
addresses = [ "tcp://192.168.0.6" "tcp://192.168.2.1" ]; addresses = [ "tcp://192.168.0.6" "tcp://192.168.2.1" ];
}; };
mini-pc = { mini-pc = {
id = "NKRWOR6-2YNLVY5-GH6TG7T-V3M4VHD-OFS4XR3-Q45CALD-JVSIBKU-JZBGRQ3"; id =
"NKRWOR6-2YNLVY5-GH6TG7T-V3M4VHD-OFS4XR3-Q45CALD-JVSIBKU-JZBGRQ3";
addresses = [ "tcp://192.168.0.10" "tcp://192.168.2.1" ];
};
mini-pc-proxmox = {
id =
"FK3DW4B-6Y7C25O-IDBSOMV-GOUSWZW-KQR7ELS-QUKS4UR-AFZXLZE-67QJXAX";
addresses = [ "tcp://192.168.0.10" "tcp://192.168.2.1" ]; addresses = [ "tcp://192.168.0.10" "tcp://192.168.2.1" ];
}; };
laptop = { laptop = {
id = "5T6Y3WO-FOQYYFQ-5MLNDSZ-7APIDUG-6KM2ZZM-RTRXMWX-MCZKLMH-BYNDJAQ"; id =
"5T6Y3WO-FOQYYFQ-5MLNDSZ-7APIDUG-6KM2ZZM-RTRXMWX-MCZKLMH-BYNDJAQ";
addresses = [ "tcp://192.168.2.22" ]; addresses = [ "tcp://192.168.2.22" ];
}; };
phone = { phone = {
id = "XFQ7MV6-MKBYQXH-WGYVQUB-BYJJPFJ-HJTNZEP-PXWAMYY-DMADWSU-PQOTVAI"; id =
"XFQ7MV6-MKBYQXH-WGYVQUB-BYJJPFJ-HJTNZEP-PXWAMYY-DMADWSU-PQOTVAI";
addresses = [ "tcp://192.168.0.15" "tcp://192.168.2.20" ]; addresses = [ "tcp://192.168.0.15" "tcp://192.168.2.20" ];
}; };
}; };
folders."${basePath}/default" = { folders."${basePath}/default" = {
id = "default"; id = "default";
devices = [ "kop-pc" "server" "laptop" "mini-pc" "phone" ]; devices =
[ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" "phone" ];
ignorePerms = false; ignorePerms = false;
}; };
folders."${basePath}/books" = { folders."${basePath}/books" = {
id = "books"; id = "books";
devices = [ "kop-pc" "server" "laptop" "mini-pc" ]; devices = [ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" ];
}; };
folders."${basePath}/fh" = { folders."${basePath}/fh" = {
id = "fh"; id = "fh";
devices = [ "kop-pc" "server" "laptop" "mini-pc" ]; devices = [ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" ];
}; };
folders."${basePath}/work_drive" = { folders."${basePath}/work_drive" = {
id = "work_drive"; id = "work_drive";
devices = [ "kop-pc" "server" "laptop" "mini-pc" ]; devices = [ "kop-pc" "server" "laptop" "mini-pc" "mini-pc-proxmox" ];
}; };
}; };
}; };

9
pkgs/test-docker.nix Normal file
View File

@@ -0,0 +1,9 @@
{ dockerTools, hello }:
dockerTools.buildLayeredImage {
name = "hello";
tag = "latest";
contents = [ hello ];
config.Cmd = [ "/bin/hello" ];
}

View File

@@ -10,6 +10,8 @@
#<home-manager/nixos> #<home-manager/nixos>
]; ];
nixpkgs.config.permittedInsecurePackages = [ "electron-27.3.11" ];
services.blueman.enable = true; services.blueman.enable = true;
hardware.bluetooth.enable = true; # enables support for Bluetooth hardware.bluetooth.enable = true; # enables support for Bluetooth

View File

@@ -24,7 +24,7 @@
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ "networkmanager" "wheel" "docker" ]; extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [ packages = with pkgs; [
discord #discord
brave brave
]; ];
openssh.authorizedKeys.keys = [ config.mainUser.sshKey ]; openssh.authorizedKeys.keys = [ config.mainUser.sshKey ];