diff --git a/flake.lock b/flake.lock index 880d73f..1a02d00 100644 --- a/flake.lock +++ b/flake.lock @@ -1,86 +1,12 @@ { "nodes": { - "crane": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1702141249, - "narHash": "sha256-8wDpJKbDTDqFmyJfNEJOLrHYDoEzCjCbmz+lSRoU3CI=", - "owner": "ipetkov", - "repo": "crane", - "rev": "62fc1a0cbe144c1014d956e603d56bf1ffe69c7d", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1702275809, - "narHash": "sha256-cd+IhiNJ9VYSheVxPzw6aLy91Q3+BUR35CtBqPCXfRE=", - "owner": "nix-community", - "repo": "fenix", - "rev": "ab4ec60bcf513278aa1e26d71ca822161075bffc", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nix-filter": { - "locked": { - "lastModified": 1701697642, - "narHash": "sha256-L217WytWZHSY8GW9Gx1A64OnNctbuDbfslaTEofXXRw=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "c843418ecfd0344ecb85844b082ff5675e02c443", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1702206697, - "narHash": "sha256-vE9oEx3Y8TO5MnWwFlmopjHd1JoEBno+EhsfUCq5iR8=", + "lastModified": 1751498133, + "narHash": "sha256-QWJ+NQbMU+NcU2xiyo7SNox1fAuwksGlQhpzBl76g1I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "29d6c96900b9b576c2fb89491452f283aa979819", + "rev": "d55716bb59b91ae9d1ced4b1ccdea7a442ecbfdb", "type": "github" }, "original": { @@ -92,28 +18,8 @@ }, "root": { "inputs": { - "crane": "crane", - "fenix": "fenix", - "flake-utils": "flake-utils", - "nix-filter": "nix-filter", - "nixpkgs": "nixpkgs" - } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1702247072, - "narHash": "sha256-JX+pWFPjckWD0Qa2oji1ZUbzL4kCIgeGsVcEb0Bnn+E=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "457b966b171b09a7e57acb710fbca29a4b3526f0", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" + "nixpkgs": "nixpkgs", + "utils": "utils" } }, "systems": { @@ -130,6 +36,24 @@ "repo": "default", "type": "github" } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 83a6b70..c16b7eb 100644 --- a/flake.nix +++ b/flake.nix @@ -3,62 +3,36 @@ 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"; - }; + utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, flake-utils, nix-filter, crane, fenix }: - flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: + outputs = { self, nixpkgs, utils }: + utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system: let - pkgs = nixpkgs.legacyPackages.${system}; - craneLib = crane.lib.${system}.overrideToolchain fenix.packages.${system}.stable.toolchain; + pkgs = import nixpkgs { inherit system; }; - pkgDef = { - src = nix-filter.lib.filter { - root = ./.; - include = [ - ./src - ./Cargo.toml - ./Cargo.lock - ]; - }; - nativeBuildInputs = with pkgs; [ pkg-config ]; - buildInputs = with pkgs; [ - systemd # For libudev - ]; - }; + runtimeDependencies = with pkgs; [ + ]; - cargoArtifacts = craneLib.buildDepsOnly pkgDef; - cosmic-settings-daemon = craneLib.buildPackage (pkgDef // { - inherit cargoArtifacts; - }); in { - checks = { - inherit cosmic-settings-daemon; - }; - - packages.default = cosmic-settings-daemon; + devShells.default = with pkgs; mkShell rec { + nativeBuildInputs = with pkgs; [ + pkg-config + ]; - apps.default = flake-utils.lib.mkApp { - drv = cosmic-settings-daemon; - }; + buildInputs = with pkgs; [ + libxkbcommon + libinput + libpulseaudio.dev + pipewire.dev + systemd + openssl + ]; - devShells.default = pkgs.mkShell { - inputsFrom = builtins.attrValues self.checks.${system}; + RUST_SRC_PATH = rustPlatform.rustLibSrc; + RUSTFLAGS = "-C link-arg=-Wl,-rpath,${pkgs.lib.makeLibraryPath runtimeDependencies}"; + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; }; - }); - - 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=" ]; - }; + } + ); }