diff options
author | Cara Salter <cara@devcara.com> | 2022-07-17 13:43:21 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-07-17 13:43:35 -0400 |
commit | 540d267acff1d6e08b017ef9a29a0cf71e5f894a (patch) | |
tree | 7a49c8fddde7e3a0d6b4231406eb6aaa1d96fcd8 | |
parent | a5486fc5a1ace4a1e74c6e4ddd5dcf61c409a386 (diff) | |
download | glitch-ng-540d267acff1d6e08b017ef9a29a0cf71e5f894a.tar.gz glitch-ng-540d267acff1d6e08b017ef9a29a0cf71e5f894a.zip |
De-nixify
-rw-r--r-- | .envrc | 1 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | flake.lock | 91 | ||||
-rw-r--r-- | flake.nix | 118 |
4 files changed, 1 insertions, 211 deletions
@@ -1 +0,0 @@ -use flake @@ -1,6 +1,6 @@ [package] name = "glitch-ng" -version = "0.6.0" +version = "0.6.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 90c5af7..0000000 --- a/flake.lock +++ /dev/null @@ -1,91 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1648297722, - "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", - "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": 1639947939, - "narHash": "sha256-pGsM8haJadVP80GFq4xhnSpNitYNQpaXk4cnA796Cso=", - "owner": "nix-community", - "repo": "naersk", - "rev": "2fc8ce9d3c025d59fee349c1f80be9785049d653", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "naersk", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1648219316, - "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "type": "indirect" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1648219316, - "narHash": "sha256-Ctij+dOi0ZZIfX5eMhgwugfvB+WZSrvVNAyAuANOsnQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "30d3d79b7d3607d56546dd2a6b49e156ba0ec634", - "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 d9c9ba5..0000000 --- a/flake.nix +++ /dev/null @@ -1,118 +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-04-30"; - channel = "nightly"; - sha256= "pKjVkFhROJV0+JZKx2n4Fn9fJFuGX8pZW3LjUAN+Jx0="; - }).rust; - - naersk-lib = naersk.lib."${system}".override { - cargo = rust; - rustc = rust; - }; - in - rec { - # `nix build` - deps = with pkgs; [ - pkg-config - openssl - gcc - glibc - ]; - packages.glitch-ng = naersk-lib.buildPackage { - pname = "glitch-ng"; - root = ./.; - buildInputs = deps; - nativeBuildInputs = deps; - }; - defaultPackage = packages.glitch-ng; - - # `nix run` - apps.glitch-ng = flake-utils.lib.mkApp { - drv = packages.glitch-ng; - }; - defaultApp = apps.glitch-ng; - - nixosModules.glitch = { config, lib, ... }: { - options = { - services.glitch-ng.enable = lib.mkEnableOption "enable glitch NG"; - services.glitch-ng.environment-file-location = lib.mkOption { - type = lib.types.path; - default = "/var/lib/glitch-ng/.env"; - description = "The location of the environment file"; - }; - }; - - config = lib.mkIf config.services.glitch-ng.enable { - users.groups.glitch-ng = { - members = [ "glitch-ng" - "${config.services.postgresql.superUser}" ]; - }; - users.users.glitch-ng = { - createHome = true; - isSystemUser = true; - home = "/var/lib/glitch-ng"; - group = "glitch-ng"; - }; - - systemd.services.glitch-ng = { - wantedBy = [ "multi-user.target" ]; - after = [ "glitch-ng-init.service" ]; - requires = [ "glitch-ng-init.service" ]; - serviceConfig = { - User = "glitch-ng"; - Group = "glitch-ng"; - Restart = "always"; - WorkingDirectory = "/var/lib/glitch-ng"; - ExecStart = "${defaultPackage}/bin/glitch-ng"; - EnvironmentFile = "${config.services.glitch-ng.environment-file-location}"; - }; - }; - - systemd.services.glitch-ng-init = { - wantedBy = [ "multi-user.target" ]; - requires = [ "postgresql.service" ]; - after = [ "postgresql.service" ]; - description = "Initialize for glitch-ng"; - - script = with pkgs; '' - if ! [ -e /var/lib/postgresql/.glitch-inited ]; then - ${config.services.postgresql.package}/bin/createuser glitch-ng - ${config.services.postgresql.package}/bin/createdb -O glitch-ng glitch - touch /var/lib/postgresql/.glitch-inited - fi - ''; - serviceConfig = { - Type = "oneshot"; - User = "${config.services.postgresql.superUser}"; - Group = "glitch-ng"; - }; - }; - - services.postgresql.enable = true; - - }; - }; - - # `nix develop` - devShell = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ rust ] ++ deps; - }; - } - ); -} |