diff options
author | Cara Salter <cara@devcara.com> | 2022-07-09 22:35:15 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-07-09 22:35:15 -0400 |
commit | 1a408b8ba3dd2b15a63f29bbd68ebd182bb154cd (patch) | |
tree | 8c5d3e94ef88a8ee636b6bd99f170fbf19ecaa98 | |
parent | 57a59a25f623302e674432049e2f2c13d6fea322 (diff) | |
download | solard-1a408b8ba3dd2b15a63f29bbd68ebd182bb154cd.tar.gz solard-1a408b8ba3dd2b15a63f29bbd68ebd182bb154cd.zip |
No flake
-rw-r--r-- | flake.lock | 91 | ||||
-rw-r--r-- | flake.nix | 95 |
2 files changed, 0 insertions, 186 deletions
diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 022400b..0000000 --- a/flake.lock +++ /dev/null @@ -1,91 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1649676176, - "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "mozpkgs": { - "flake": false, - "locked": { - "lastModified": 1650459918, - "narHash": "sha256-sroCK+QJTmoXtcRkwZyKOP9iAYOPID2Bwdxn4GkG16w=", - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "rev": "e1f7540fc0a8b989fb8cf701dc4fd7fc76bcf168", - "type": "github" - }, - "original": { - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "type": "github" - } - }, - "naersk": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1650265945, - "narHash": "sha256-SO8+1db4jTOjnwP++29vVgImLIfETSXyoz0FuLkiikE=", - "owner": "nix-community", - "repo": "naersk", - "rev": "e8f9f8d037774becd82fce2781e1abdb7836d7df", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "naersk", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1650194139, - "narHash": "sha256-kurZsqeOw5fpqA/Ig+8tHvbjwzs5P9AE6WUKOX1m6qM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "bd4dffcdb7c577d74745bd1eff6230172bd176d5", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1650194139, - "narHash": "sha256-kurZsqeOw5fpqA/Ig+8tHvbjwzs5P9AE6WUKOX1m6qM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "bd4dffcdb7c577d74745bd1eff6230172bd176d5", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "mozpkgs": "mozpkgs", - "naersk": "naersk", - "nixpkgs": "nixpkgs_2" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index e7abd18..0000000 --- a/flake.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ - inputs = { - flake-utils.url = "github:numtide/flake-utils"; - naersk.url = "github:nix-community/naersk"; - - mozpkgs = { - url = "github:mozilla/nixpkgs-mozilla"; - flake = false; - }; - }; - - outputs = { self, nixpkgs, flake-utils, naersk, mozpkgs }: - flake-utils.lib.eachDefaultSystem ( - system: let - pkgs = nixpkgs.legacyPackages."${system}"; - - mozilla = pkgs.callPackage (mozpkgs + "/package-set.nix") {}; - rust = (mozilla.rustChannelOf { - date = "2022-06-10"; - channel = "nightly"; - sha256 = "pKjVkFhROJV0+JZKx2n4Fn9fJFuGX8pZW3LjUAN+Jx0="; - }).rust; - naersk-lib = naersk.lib."${system}".override { - cargo = rust; - rustc = rust; - }; - deps = with pkgs; [ - libvirt - pkg-config - openssl - ]; - in - rec { - # `nix build` - packages.solard = naersk-lib.buildPackage { - pname = "solard"; - root = ./.; - nativeBuildInputs = deps; - buildInputs = deps; - }; - defaultPackage = packages.solard; - - # `nix run` - apps.solard = flake-utils.lib.mkApp { - drv = packages.solard; - }; - defaultApp = apps.solard; - - nixosModules.solard = { config, lib, ... }: { - options = with lib; { - cara.services.solard.enable = mkEnableOption "enable solard"; - cara.services.solard.environmentFileLocation = mkOption { - type = types.str; - default = "/var/lib/solard/.env"; - description = "The location of the environment file"; - }; - cara.services.solard.port = mkOption { - type = types.port; - default = 3000; - description = "port to bind to"; - }; - }; - - config = lib.mkIf config.cara.services.solard.enable { - users.groups.solard = { - members = [ "solard" ]; - }; - users.users.solard = { - createHome = true; - isSystemUser = true; - home = "/var/lib/solard"; - group = "solard"; - extraGroups = [ "libvirtd" ]; - }; - - systemd.services.solard = { - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - User = "solard"; - Group = "solard"; - Restart = "always"; - WorkingDirectory = "/var/lib/solard"; - ExecStart = "${defaultPackage}/bin/solard"; - EnvironmentFIle = "${config.cara.services.solard.environmentFileLocation}"; - }; - }; - - networking.firewall.allowedTCPPorts = [ config.cara.services.solard.port ]; - - }; - }; - } - ); -} |