ATproto Nix User Repo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

parameterize modules with packages and use adminPasswordFile

Ryan Gibb 089cb2ae 6d6e9ea1

+41 -23
+7 -6
flake.nix
··· 18 18 search, 19 19 ... 20 20 }: 21 - flake-utils.lib.eachDefaultSystem ( 21 + (flake-utils.lib.eachDefaultSystem ( 22 22 system: 23 23 let 24 24 overlays = [ (import rust-overlay) ]; ··· 39 39 search = search.packages.${system}.default; 40 40 }; 41 41 legacyPackages = packages; 42 - nixosModules = { 43 - nur-atproto = import ./modules; 44 - search = search.nixosModules.default; 45 - }; 46 42 devShells.default = pkgs.mkShell { 47 43 # todo 48 44 }; 49 45 } 50 - ); 46 + )) // { 47 + nixosModules = { 48 + nur-atproto.imports = [ (import ./modules self.packages) ]; 49 + search = search.nixosModules.default; 50 + }; 51 + }; 51 52 }
+2 -1
modules/bluesky/beemo.nix
··· 1 + packages: 1 2 { lib, config, pkgs, ... }: 2 3 3 4 with lib; ··· 11 12 12 13 package = mkOption { 13 14 type = types.package; 14 - default = pkgs.bluesky; 15 + default = packages.${config.nixpkgs.hostPlatform.system}.bluesky; 15 16 description = "The beemo package to use."; 16 17 }; 17 18
+2 -1
modules/bluesky/bigsky.nix
··· 1 + packages: 1 2 { lib, config, pkgs, ... }: 2 3 3 4 with lib; ··· 11 12 12 13 package = mkOption { 13 14 type = types.package; 14 - default = pkgs.bluesky; 15 + default = packages.${config.nixpkgs.hostPlatform.system}.bluesky; 15 16 description = "The bigsky package to use."; 16 17 }; 17 18 };
+7 -6
modules/bluesky/default.nix
··· 1 + packages: 1 2 { lib, config, pkgs, ... }: 2 3 3 4 { 4 5 imports = [ 5 - ./bigsky.nix 6 - ./relay.nix 7 - ./hepa.nix 8 - ./palomar.nix 9 - ./beemo.nix 10 - ./sonar.nix 6 + (import ./bigsky.nix packages) 7 + (import ./relay.nix packages) 8 + (import ./hepa.nix packages) 9 + (import ./palomar.nix packages) 10 + (import ./beemo.nix packages) 11 + (import ./sonar.nix packages) 11 12 ]; 12 13 }
+2 -1
modules/bluesky/hepa.nix
··· 1 + packages: 1 2 { lib, config, pkgs, ... }: 2 3 3 4 with lib; ··· 11 12 12 13 package = mkOption { 13 14 type = types.package; 14 - default = pkgs.bluesky; 15 + default = packages.${config.nixpkgs.hostPlatform.system}.bluesky; 15 16 description = "The hepa package to use."; 16 17 }; 17 18
+2 -1
modules/bluesky/palomar.nix
··· 1 + packages: 1 2 { lib, config, pkgs, ... }: 2 3 3 4 with lib; ··· 11 12 12 13 package = mkOption { 13 14 type = types.package; 14 - default = pkgs.bluesky; 15 + default = packages.${config.nixpkgs.hostPlatform.system}.bluesky; 15 16 description = "The palomar package to use."; 16 17 }; 17 18
+15 -5
modules/bluesky/relay.nix
··· 1 + packages: 1 2 { lib, config, pkgs, ... }: 2 3 3 4 with lib; ··· 11 12 12 13 package = mkOption { 13 14 type = types.package; 14 - default = pkgs.bluesky; 15 + default = packages.${config.nixpkgs.hostPlatform.system}.bluesky; 15 16 description = "The relay package to use."; 16 17 }; 17 18 18 - adminPassword = mkOption { 19 - type = types.str; 20 - description = "Admin password for the relay."; 19 + adminPasswordFile = mkOption { 20 + type = types.nullOr types.path; 21 + default = null; 22 + description = "Path to file containing the admin password for the relay."; 21 23 }; 22 24 23 25 plcHost = mkOption { ··· 28 30 }; 29 31 30 32 config = mkIf cfg.enable { 33 + assertions = [ 34 + { 35 + assertion = cfg.adminPasswordFile != null; 36 + message = "services.relay.adminPasswordFile must be set"; 37 + } 38 + ]; 39 + 31 40 systemd.services.relay = { 32 41 description = "relay service"; 33 42 after = [ "network.target" ]; 34 43 wantedBy = [ "multi-user.target" ]; 35 44 serviceConfig = { 36 - ExecStart = "${cfg.package}/bin/relay serve --admin-password ${cfg.adminPassword} --plc-host ${cfg.plcHost}"; 45 + LoadCredential = "admin-password:${cfg.adminPasswordFile}"; 46 + ExecStart = "${pkgs.bash}/bin/bash -c '${cfg.package}/bin/relay serve --admin-password $(cat $CREDENTIALS_DIRECTORY/admin-password) --plc-host ${cfg.plcHost}'"; 37 47 Restart = "on-failure"; 38 48 }; 39 49 };
+2 -1
modules/bluesky/sonar.nix
··· 1 + packages: 1 2 { lib, config, pkgs, ... }: 2 3 3 4 with lib; ··· 11 12 12 13 package = mkOption { 13 14 type = types.package; 14 - default = pkgs.bluesky; 15 + default = packages.${config.nixpkgs.hostPlatform.system}.bluesky; 15 16 description = "The sonar package to use."; 16 17 }; 17 18
+2 -1
modules/default.nix
··· 1 + packages: 1 2 { 2 3 imports = [ 3 - ./bluesky 4 + (import ./bluesky packages) 4 5 ]; 5 6 }