diff --git a/.woodpecker/check.yml b/.woodpecker/check.yml index c3b00ef..23e442b 100644 --- a/.woodpecker/check.yml +++ b/.woodpecker/check.yml @@ -1,5 +1,5 @@ labels: - type: exec + backend: exec pipeline: - name: nix flake check @@ -7,6 +7,16 @@ pipeline: commands: - nix flake check +- name: deploy + image: bash + commands: + # We already ran the checks in the previous step + - deploy --skip-checks + when: + # FIXME: disable PR + branch: + - main + - name: notifiy image: bash secrets: diff --git a/flake.lock b/flake.lock index 79dd32a..5f400e3 100644 --- a/flake.lock +++ b/flake.lock @@ -47,6 +47,33 @@ "type": "github" } }, + "deploy-rs": { + "inputs": { + "flake-compat": [ + "flake-compat" + ], + "nixpkgs": [ + "nixpkgs" + ], + "utils": [ + "futils" + ] + }, + "locked": { + "lastModified": 1674127017, + "narHash": "sha256-QO1xF7stu5ZMDLbHN30LFolMAwY6TVlzYvQoUs1RD68=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "8c9ea9605eed20528bf60fae35a2b613b901fd77", + "type": "github" + }, + "original": { + "owner": "serokell", + "ref": "master", + "repo": "deploy-rs", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -59,6 +86,7 @@ }, "original": { "owner": "edolstra", + "ref": "master", "repo": "flake-compat", "type": "github" } @@ -179,7 +207,9 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": [ + "flake-compat" + ], "flake-utils": [ "futils" ], @@ -209,6 +239,8 @@ "root": { "inputs": { "agenix": "agenix", + "deploy-rs": "deploy-rs", + "flake-compat": "flake-compat", "flake-parts": "flake-parts", "futils": "futils", "home-manager": "home-manager", diff --git a/flake.nix b/flake.nix index 8e46ea3..209a368 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,26 @@ }; }; + deploy-rs = { + type = "github"; + owner = "serokell"; + repo = "deploy-rs"; + ref = "master"; + inputs = { + flake-compat.follows = "flake-compat"; + nixpkgs.follows = "nixpkgs"; + utils.follows = "futils"; + }; + }; + + flake-compat = { + type = "github"; + owner = "edolstra"; + repo = "flake-compat"; + ref = "master"; + flake = false; + }; + flake-parts = { type = "github"; owner = "hercules-ci"; @@ -59,6 +79,7 @@ repo = "pre-commit-hooks.nix"; ref = "master"; inputs = { + flake-compat.follows = "flake-compat"; flake-utils.follows = "futils"; nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs"; diff --git a/flake/default.nix b/flake/default.nix index 65102e1..5feacbf 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -11,6 +11,7 @@ flake-parts.lib.mkFlake { inherit inputs; } { imports = [ ./apps.nix ./checks.nix + ./deploy-rs.nix ./dev-shells.nix ./home-manager.nix ./lib.nix diff --git a/flake/deploy-rs.nix b/flake/deploy-rs.nix new file mode 100644 index 0000000..9d2fb17 --- /dev/null +++ b/flake/deploy-rs.nix @@ -0,0 +1,26 @@ +{ self, inputs, ... }: +let + inherit (inputs) + deploy-rs + ; + inherit (self) lib; +in +{ + perSystem = { system, ... }: { + checks = deploy-rs.lib.${system}.deployChecks self.deploy; + }; + + flake = { + deploy = { + nodes = { + porthos = { + hostname = "belanyi.fr"; + profiles.system = { + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.porthos; + }; + }; + }; + }; + }; +}