-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a flake.nix with cachix for nix build support
- Loading branch information
1 parent
6714f4d
commit f70a2df
Showing
6 changed files
with
195 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build and Upload Binary | ||
name: Build and Upload AppImage Binary | ||
|
||
on: | ||
workflow_dispatch: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "Nix Build and Cache" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "main build" | ||
required: true | ||
default: "main" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v30 | ||
- uses: cachix/cachix-action@v15 | ||
with: | ||
name: wombatfromhell | ||
authToken: "${{ secrets.CACHIX_TOKEN }}" | ||
- run: nix build . --print-out-paths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
veridian-controller.toml | ||
target | ||
result | ||
veridian-controller.toml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
description = "Veridian Controller"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
naersk.url = "github:nix-community/naersk"; | ||
}; | ||
|
||
nixConfig = { | ||
extra-substituters = [ | ||
"https://wombatfromhell.cachix.org/" | ||
]; | ||
extra-trusted-public-keys = [ | ||
"wombatfromhell.cachix.org-1:pyIVJJkoLxkjH/MKK1ylrrdJKPpm+aXLeD2zAqVk9lA=" | ||
]; | ||
}; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
flake-utils, | ||
naersk, | ||
}: | ||
flake-utils.lib.eachDefaultSystem (system: let | ||
pkgs = import nixpkgs {inherit system;}; | ||
naersk' = pkgs.callPackage naersk {}; | ||
in { | ||
packages = { | ||
veridian-controller = naersk'.buildPackage { | ||
pname = "veridian-controller"; | ||
version = "0.2.6"; | ||
src = ./.; | ||
}; | ||
default = self.packages.${system}.veridian-controller; | ||
}; | ||
|
||
overlays.default = final: prev: { | ||
veridian-controller = self.packages.${prev.system}.veridian-controller; | ||
}; | ||
|
||
apps.default = flake-utils.lib.mkApp { | ||
drv = self.packages.${system}.default; | ||
}; | ||
}) | ||
// { | ||
nixosModules.default = { | ||
config, | ||
pkgs, | ||
... | ||
}: { | ||
nixpkgs.overlays = [self.overlays.default]; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# include this module in your home-manager config | ||
{ | ||
pkgs, # make sure to include the input from your flake | ||
... | ||
}: let | ||
moduleName = "veridian-controller"; | ||
description = "Veridian Controller User Fan Service"; | ||
in { | ||
# systemd user service to start the fan controller on startup | ||
systemd.user.services."${moduleName}" = { | ||
Unit = { | ||
Description = "${description}"; | ||
}; | ||
Service = { | ||
Type = "simple"; | ||
ExecStart = "${pkgs.${moduleName}}/bin/${moduleName}"; | ||
}; | ||
Install = { | ||
WantedBy = ["graphical-session.target"]; | ||
}; | ||
}; | ||
} |