From 1a408b8ba3dd2b15a63f29bbd68ebd182bb154cd Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sat, 9 Jul 2022 22:35:15 -0400 Subject: No flake --- flake.nix | 95 --------------------------------------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 flake.nix (limited to 'flake.nix') 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 ]; - - }; - }; - } - ); -} -- cgit v1.2.3