-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c58c3fc
commit 37fd3fd
Showing
3 changed files
with
243 additions
and
0 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 +1,2 @@ | ||
target/ | ||
/result |
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,64 @@ | ||
{ | ||
description = "Settings daemon for the COSMIC desktop environment"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nix-filter.url = "github:numtide/nix-filter"; | ||
crane = { | ||
url = "github:ipetkov/crane"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
fenix = { | ||
url = "github:nix-community/fenix"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, nix-filter, crane, fenix }: | ||
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
craneLib = crane.lib.${system}.overrideToolchain fenix.packages.${system}.stable.toolchain; | ||
|
||
pkgDef = { | ||
src = nix-filter.lib.filter { | ||
root = ./.; | ||
include = [ | ||
./src | ||
./Cargo.toml | ||
./Cargo.lock | ||
]; | ||
}; | ||
nativeBuildInputs = with pkgs; [ pkg-config ]; | ||
buildInputs = with pkgs; [ | ||
systemd # For libudev | ||
]; | ||
}; | ||
|
||
cargoArtifacts = craneLib.buildDepsOnly pkgDef; | ||
cosmic-settings-daemon = craneLib.buildPackage (pkgDef // { | ||
inherit cargoArtifacts; | ||
}); | ||
in { | ||
checks = { | ||
inherit cosmic-settings-daemon; | ||
}; | ||
|
||
packages.default = cosmic-settings-daemon; | ||
|
||
apps.default = flake-utils.lib.mkApp { | ||
drv = cosmic-settings-daemon; | ||
}; | ||
|
||
devShells.default = pkgs.mkShell { | ||
inputsFrom = builtins.attrValues self.checks.${system}; | ||
}; | ||
}); | ||
|
||
nixConfig = { | ||
# Cache for the Rust toolchain in fenix | ||
extra-substituters = [ "https://nix-community.cachix.org" ]; | ||
extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; | ||
}; | ||
} |