From 8d35835f8988735a23e30fc9e565c43b374a100c Mon Sep 17 00:00:00 2001 From: DashieTM Date: Sat, 3 Aug 2024 23:16:09 +0200 Subject: [PATCH] Fixup modules --- flake.lock | 26 ++++----- hardware/marmo/configuration.nix | 2 +- modules/programs/default.nix | 2 + modules/programs/hyprland/hyprland.nix | 4 +- modules/programs/nextcloud.nix | 81 ++++++++++++++++++++++++++ programs/common.nix | 1 + secrets/secrets.yaml | 7 ++- 7 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 modules/programs/nextcloud.nix diff --git a/flake.lock b/flake.lock index ebbb13c..748aea8 100644 --- a/flake.lock +++ b/flake.lock @@ -790,11 +790,11 @@ ] }, "locked": { - "lastModified": 1722462338, - "narHash": "sha256-ss0G8t8RJVDewA3MyqgAlV951cWRK6EtVhVKEZ7J5LU=", + "lastModified": 1722630065, + "narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=", "owner": "nix-community", "repo": "home-manager", - "rev": "6e090576c4824b16e8759ebca3958c5b09659ee8", + "rev": "afc892db74d65042031a093adb6010c4c3378422", "type": "github" }, "original": { @@ -884,11 +884,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1722551504, - "narHash": "sha256-/N8voFoU8ALTK8C1esM6MM+lj9zZGCG4lbvH0mNBQUE=", + "lastModified": 1722707408, + "narHash": "sha256-hyTuWhcid8UklJBC4Yh3dpf7Xhx4oJDyM/3n10E1wSk=", "ref": "refs/heads/main", - "rev": "09bb5658b7fa6c0dc4e2744797e51ad4dd25af42", - "revCount": 5041, + "rev": "51ffd7fa6f186419276e5d3d5fe141a3fdb3c55c", + "revCount": 5048, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -1013,11 +1013,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1721682203, - "narHash": "sha256-nCW+lmRn0m/xupLGYcJYslwI/DWrv1PAdlIISFYye8c=", + "lastModified": 1722698043, + "narHash": "sha256-Hsgi1DJP+oodbsULTrqpO6KPSJYeyswluNLVGxUtwJE=", "owner": "JakeStanger", "repo": "ironbar", - "rev": "e1d55c697258b3a19973758b739c5f0c2867477f", + "rev": "6e43c7ae0cce4b8c6dfe2f74756574195b944abe", "type": "github" }, "original": { @@ -1487,11 +1487,11 @@ }, "nur": { "locked": { - "lastModified": 1722557227, - "narHash": "sha256-OoiYLF9q6RTBV6mEcjAyhzd/vt0J/oh11IcpXio7HdY=", + "lastModified": 1722709906, + "narHash": "sha256-I27FkJ3qSsxc5aZSwpYHMqJwLpvQt6eV4MrwGfVjCvM=", "owner": "nix-community", "repo": "nur", - "rev": "2f48eed087e71bcaf366221f7f10103d41004c03", + "rev": "ac1226f223779364c73f1a450654383768dab1b7", "type": "github" }, "original": { diff --git a/hardware/marmo/configuration.nix b/hardware/marmo/configuration.nix index c505cf8..4327b2e 100644 --- a/hardware/marmo/configuration.nix +++ b/hardware/marmo/configuration.nix @@ -1,6 +1,6 @@ { imports = [ - ../../modules/conf.nix + ../../modules ]; # variables for system conf = { diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 2096c6a..305ce4d 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -15,7 +15,9 @@ ./base_packages.nix ./home_packages.nix ./media.nix + ./coding.nix ./flatpak.nix + ./nextcloud.nix ./hyprland ]; } diff --git a/modules/programs/hyprland/hyprland.nix b/modules/programs/hyprland/hyprland.nix index a8034ee..a9edb5e 100644 --- a/modules/programs/hyprland/hyprland.nix +++ b/modules/programs/hyprland/hyprland.nix @@ -209,8 +209,8 @@ }; input = { - kb_layout = "{config.mods.xkb.layout}"; - kb_variant = "{config.mods.xkb.variant}"; + kb_layout = "${config.mods.xkb.layout}"; + kb_variant = "${config.mods.xkb.variant}"; repeat_delay = 200; force_no_accel = true; touchpad = { diff --git a/modules/programs/nextcloud.nix b/modules/programs/nextcloud.nix new file mode 100644 index 0000000..d6a0b10 --- /dev/null +++ b/modules/programs/nextcloud.nix @@ -0,0 +1,81 @@ +{ lib, config, pkgs, options, ... }: { + options.mods = { + nextcloud = { + enable = lib.mkOption { + default = true; + example = false; + type = lib.types.bool; + description = "Enable nextcloud"; + }; + username = lib.mkOption { + default = "DashieTM"; + example = "globi"; + type = lib.types.str; + description = "Your username"; + }; + url = lib.mkOption { + default = "cloud.dashie.org"; + example = "cloud.globi.org"; + type = lib.types.str; + description = "Your url"; + }; + synclist = lib.mkOption { + default = [ ]; + example = [ + { + name = "sync globi folder"; + remote = "globi"; + local = "/home/globi"; + } + ]; + description = '' + A list of folders to synchronize. + This has to be an attribute list with the name, remote and local field (all strings). + ''; + }; + }; + }; + + # config = + # let + # username = config.mods.nextcloud.username; + # password = config.sops.secrets.nextcloud; + # url = config.mods.nextcloud.url; + # synclist = config.mods.nextcloud.synclist; + # name = "test"; + # local = "test"; + # remote = "test"; + # in + # lib.mkIf config.mods.nextcloud.enable + # (lib.optionalAttrs (options?systemd.user.startServices) #{ + # builtins.listToAttrs + # (map + # ({ name, remote, local }: { + # systemd.user = { + # services."${name}" = { + # Unit = { + # Description = "Auto sync Nextcloud"; + # After = "network-online.target"; + # }; + # Service = { + # Type = "simple"; + # ExecStart = "${pkgs.nextcloud-client}/bin/nextcloudcmd -h --path ${remote} ${local} https://${username}:${password}@${url}"; + # TimeoutStopSec = "180"; + # KillMode = "process"; + # KillSignal = "SIGINT"; + # }; + # Install.WantedBy = [ "multi-user.target" ]; + # }; + # timers.${name} = { + # Unit.Description = "Automatic sync files with Nextcloud when booted up after 1 minute then rerun every 60 minutes"; + # Timer.OnBootSec = "1min"; + # Timer.OnUnitActiveSec = "60min"; + # Install.WantedBy = [ "multi-user.target" "timers.target" ]; + # }; + # startServices = true; + # }; + # # }); + # })) + # synclist + # ); +} diff --git a/programs/common.nix b/programs/common.nix index 02d3034..b6d93b9 100644 --- a/programs/common.nix +++ b/programs/common.nix @@ -46,6 +46,7 @@ in secrets.hub = { }; secrets.lab = { }; secrets.${username} = { }; + secrets.nextcloud = { }; }; systemd.user.services.mbsync.Unit.After = [ "sops-nix.service" ]; } diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml index 6be4816..b0d8ae7 100644 --- a/secrets/secrets.yaml +++ b/secrets/secrets.yaml @@ -5,14 +5,15 @@ hub_pub: ENC[AES256_GCM,data:6vIAQWFMIR+HnERg+A4jKu/MW+e7eLQplmdJyBeuBL9tvxH1idT lab_pub: ENC[AES256_GCM,data:rlHCiqGnoaPiQBaZQRT+bEjfNF7jNO4CGPoCOKJ1o7nv7i2jPy6Bq9OMBHXsMHI9oGfEhyKCDHdpJ65aI07KJC/fMoMoAyiNmalwNOn26jbgj84mfENS3IYbfKxQVXAUCJHE5m1cFsm7,iv:8SLdHLYq2tlfHBjdeDoByEzGuu3TURj4+KJvQfPuaWA=,tag:mmGXlRwQ0UoVIAJE6d1OUQ==,type:str] dashie_pub: ENC[AES256_GCM,data:k6JIJOKDJcGSW47Z8y0EYxNl/vaPRVbIn35CSA57snEzYnk5GpU+1NfPDniWoAGRkpIwicgN6kpzssRlKOmVudvwMejSLv4VkLRBjrsApVFECwoIBLUNGUSDaMcIwC/BYu4jfjGaozBj,iv:0EZ0rptLdmcuTU1BGOILaaDTrc7aZGJCCxgjUESqi0M=,tag:dlQs/ugBGxnSrNj/bRSJSw==,type:str] server_pub: ENC[AES256_GCM,data:87nTYzA8CykOPjfZS2As8+JB/ysJvHXFYbPIBA8Nus8Y3nI3Tl2F/f7mUVFBT+4mmOFTTwxghEnkpgTg/vzUm6W4wb19rIcv11eM7HYaGl5oI44a44rBJn2+PKlfIgXVgaY=,iv:O7I7kkZ44McXzCt3wH1cM3MJCShxu2O+0U0+Y6rwePo=,tag:q5D5AGMmFyiNhQNR8dRB+g==,type:str] +nextcloud: ENC[AES256_GCM,data:gJOgw6lYjEDt3Xgqm4Y2P8uqyCpP8hYXkbU=,iv:9J6ksbxnmWBqOMGcRzcV7/4pnEfeltn9JuSFownXZSk=,tag:trnz5520V01aPsef9sxJuw==,type:str] sops: kms: [] gcp_kms: [] azure_kv: [] hc_vault: [] age: [] - lastmodified: "2024-07-08T18:00:49Z" - mac: ENC[AES256_GCM,data:66P0uEUhQit+EjBEhAoQP3yVAt988eYwwxnOPGahPfKDw5ud+b8atc9mT6vGK3TfQFoZfjwhRxEOmc/Wx/PA+L01S7gAFctKrnbADAfRn7HJmtX3pXunhDxI6hGyJW+CrFNiLhViMJSXHljhj/QfDmxkJ/6TSSi8uMr2iNlLA3I=,iv:AJ4RB0CV0QAumZ6o36loeR51GUxQKnEsUklIGJnn5qI=,tag:or1MamtafGlwBRr/JsL9Eg==,type:str] + lastmodified: "2024-08-03T20:23:57Z" + mac: ENC[AES256_GCM,data:e3fQXTDmWZpPt0ymvVxbuE4FLusChsVKVDZqx1pOfXSZMTphosUW5nghoQnER6Yvi2V5paaAVFhSM/FTSu7/5YU0nffgaMFRSxsao9ds9YZV2b/4cWwveGRB07C0OKPDSYX3+NDIPBmDMM2hVLBexvS0Z0BC5bKloCFw1OFprcg=,iv:fniuutOwbeEvVObNI48TZmiv16WWYudeFMSmWo69h+g=,tag:P1z44JgBuTnXyZVCVgZwLg==,type:str] pgp: - created_at: "2024-05-14T14:35:02Z" enc: |- @@ -27,4 +28,4 @@ sops: -----END PGP MESSAGE----- fp: 92D29D420B5D95FCA46A12FE778CFA7A623614F3 unencrypted_suffix: _unencrypted - version: 3.8.1 + version: 3.9.0