diff --git a/configurations/home/srid@sensuous.nix b/configurations/home/srid@sensuous.nix index 34c325c..08a41e0 100644 --- a/configurations/home/srid@sensuous.nix +++ b/configurations/home/srid@sensuous.nix @@ -7,6 +7,7 @@ in imports = [ self.homeModules.default self.homeModules.linux-only + (self + /modules/home/all/vira.nix) ]; home.username = "srid"; diff --git a/configurations/nixos/pureintent/default.nix b/configurations/nixos/pureintent/default.nix index f5c5495..c29dad7 100644 --- a/configurations/nixos/pureintent/default.nix +++ b/configurations/nixos/pureintent/default.nix @@ -10,8 +10,6 @@ in imports = [ self.nixosModules.default ./configuration.nix - # ./home-media.nix - (self + /modules/nixos/linux/vira.nix) (self + /modules/nixos/linux/eternal-terminal.nix) (self + /modules/nixos/shared/github-runner.nix) ]; diff --git a/flake.lock b/flake.lock index f771935..cf6a001 100644 --- a/flake.lock +++ b/flake.lock @@ -1147,16 +1147,16 @@ "tabler-icons-hs": "tabler-icons-hs" }, "locked": { - "lastModified": 1757210792, - "narHash": "sha256-0zYOvVuoJCJ2WxZ0j7tMfRmsfkVw/FGjdEInqTK5sek=", + "lastModified": 1757285089, + "narHash": "sha256-GpzlomG05UNij+2i1LFKNACMPUQGfFToL1QyUGi7C+o=", "owner": "juspay", "repo": "vira", - "rev": "a04d70b44bed44fa7d5533bdb436e685cd3f8dd3", + "rev": "be4acdbecd2582975d3b0f4dfc8d8e21e280ee61", "type": "github" }, "original": { "owner": "juspay", - "ref": "rich-commit", + "ref": "pull/144/head", "repo": "vira", "type": "github" } diff --git a/flake.nix b/flake.nix index 6cf94b3..ff0a57a 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ flake-parts.follows = "flake-parts"; }; try.url = "github:tobi/try"; - vira.url = "github:juspay/vira/rich-commit"; + vira.url = "github:juspay/vira/pull/144/head"; # Neovim nixvim.url = "github:nix-community/nixvim"; diff --git a/modules/home/all/vira.nix b/modules/home/all/vira.nix new file mode 100644 index 0000000..2b5f473 --- /dev/null +++ b/modules/home/all/vira.nix @@ -0,0 +1,26 @@ +{ flake, pkgs, ... }: + +let + inherit (flake) inputs; +in +{ + imports = [ + inputs.vira.homeManagerModules.vira + ]; + + services.vira = { + enable = true; + hostname = "0.0.0.0"; + port = 5001; + https = true; + package = inputs.vira.packages.${pkgs.system}.default; + + initialState = { + repositories = { + nixos-config = "https://github.com/srid/nixos-config.git"; + haskell-flake = "https://github.com/srid/haskell-flake.git"; + vira = "https://github.com/juspay/vira.git"; + }; + }; + }; +} diff --git a/modules/nixos/linux/vira.nix b/modules/nixos/linux/vira.nix deleted file mode 100644 index b616d84..0000000 --- a/modules/nixos/linux/vira.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ flake, pkgs, ... }: - -let - inherit (flake) inputs; -in -{ - imports = [ - inputs.vira.nixosModules.vira - ]; - - services.vira = { - enable = true; - stateDir = "/var/lib/vira"; - hostname = "127.0.0.1"; # Cuz, nginx reverse proxy - port = 5001; - https = false; # Cuz, nginx reverse proxy - basePath = "/vira/"; # Cuz, nginx reverse proxy - package = inputs.vira.packages.${pkgs.system}.default; - - initialState = { - repositories = { - nixos-config = "https://github.com/srid/nixos-config.git"; - haskell-flake = "https://github.com/srid/haskell-flake.git"; - vira = "https://github.com/juspay/vira.git"; - }; - }; - }; - - # Configure nginx reverse proxy for vira with SSL - services.nginx = { - enable = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - virtualHosts."pureintent" = { - forceSSL = true; - enableACME = false; - sslCertificate = "/var/lib/acme/pureintent/cert.pem"; - sslCertificateKey = "/var/lib/acme/pureintent/key.pem"; - locations."/vira/" = { - proxyPass = "http://127.0.0.1:5001/"; - proxyWebsockets = true; - extraConfig = '' - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - ''; - }; - }; - }; - - # Generate self-signed certificate for nginx - systemd.services.nginx-self-signed-cert = { - description = "Generate self-signed certificate for nginx"; - wantedBy = [ "multi-user.target" ]; - before = [ "nginx.service" ]; - script = '' - mkdir -p /var/lib/acme/pureintent - if [ ! -f /var/lib/acme/pureintent/cert.pem ] || [ ! -f /var/lib/acme/pureintent/key.pem ]; then - ${pkgs.openssl}/bin/openssl req -x509 -newkey rsa:4096 -keyout /var/lib/acme/pureintent/key.pem -out /var/lib/acme/pureintent/cert.pem -days 365 -nodes -subj "/C=US/ST=Local/L=Local/O=Local/CN=pureintent" - chmod 600 /var/lib/acme/pureintent/key.pem - chmod 644 /var/lib/acme/pureintent/cert.pem - chown -R nginx:nginx /var/lib/acme/pureintent - fi - ''; - serviceConfig = { - Type = "oneshot"; - User = "root"; - }; - }; - - -}