Skip to content

Commit

Permalink
feat(todo): added desktop application for TODO: Planify
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed May 25, 2024
1 parent 5cce873 commit ef512d5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
with lib;
let
dotfilesPath = ./../dotfiles;
secretDir = ./../secrets;
in
attrsets.mapAttrs'
(n: v: {
name = strings.removeSuffix ".nix" n;
value = import (./. + "/${n}") { inherit lib pkgs dotfilesPath privateRepo unstable inputs system; };
value = import (./. + "/${n}") { inherit lib pkgs dotfilesPath privateRepo unstable inputs system secretDir; };
})
(builtins.readDir ./.)
4 changes: 2 additions & 2 deletions lib/desktop.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ pkgs, lib, unstable, ... }:
{ pkgs, lib, unstable, secretDir, ... }:
with lib;
with lib.my;
let
mkDesktopApp = config: dotfiles: name: desktopName: import (./../modules/desktop/submodules + "/${name}.nix") {
inherit pkgs dotfiles config unstable lib desktopName;
inherit pkgs dotfiles config unstable lib desktopName secretDir;
};
in
{
Expand Down
5 changes: 2 additions & 3 deletions lib/hosts.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, system, pkgs, unstable, privateRepo, inputs, dotfilesPath, ... }:
{ lib, system, pkgs, unstable, privateRepo, inputs, dotfilesPath, secretDir, ... }:
with lib;
with lib.my;
let
Expand Down Expand Up @@ -39,8 +39,7 @@ in
inherit system;

specialArgs = {
inherit pkgs unstable lib dotfiles isDevMode inputs privateRepo system hostname desktopName;
secretDir = ./../secrets;
inherit pkgs unstable lib dotfiles isDevMode inputs privateRepo system hostname desktopName secretDir;
templateDir = ./../templates;
};

Expand Down
40 changes: 40 additions & 0 deletions modules/desktop/submodules/todo.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ lib, unstable, secretDir, ... }:
with lib;
with lib.my;
let
port = 5232;
certPath = (secretDir + "/certificate.pem");
keyPath = (secretDir + "/privatekey.pem");
in
{
autostart = autostart.mkAutostart { programs = [ "planify" ]; pkg = unstable; };

config = {
networking.firewall.interfaces.eno1.allowedTCPPorts = [ port ];

services = {
accounts-daemon.enable = true;
passSecretService.enable = true;
radicale = {
enable = true;
settings = {
server = {
hosts = [ "0.0.0.0:${builtins.toString port}" ];
ssl = true;
certificate = builtins.toString certPath;
key = builtins.toString keyPath;
};
auth = {
type = "htpasswd";
htpasswd_filename = "/var/lib/radicale/users";
htpasswd_encryption = "bcrypt";
};
};
};
};

security.pki.certificateFiles = [ certPath ];

home-manager.users.wittano.home.packages = with unstable; [ planify ];
};
}

0 comments on commit ef512d5

Please sign in to comment.