From 71782da245b16d7566e7818ab8b41d8a1f9057ff Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 6 Aug 2023 17:51:18 -0600 Subject: [PATCH] Add nix flake --- flake.lock | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 34 +++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..6afc8e3e --- /dev/null +++ b/flake.lock @@ -0,0 +1,80 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-ignore-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "ref": "master", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1691186842, + "narHash": "sha256-wxBVCvZUwq+XS4N4t9NqsHV4E64cPVqQ2fdDISpjcw0=", + "path": "/nix/store/d42v5grfq77vr10r336kks0qjp0wij8d-source", + "rev": "18036c0be90f4e308ae3ebcab0e14aae0336fe42", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "git-ignore-nix": "git-ignore-nix", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..76c0db06 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + inputs = { + flake-utils.url = github:numtide/flake-utils; + git-ignore-nix = { + url = github:hercules-ci/gitignore.nix/master; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = { + self, flake-utils, nixpkgs, git-ignore-nix, ... + }: flake-utils.lib.eachDefaultSystem (system: let + overlay = self: super: { + picom = super.picom.overrideAttrs (oldAttrs: rec { + pname = "picom"; + buildInputs = [ + self.pcre2 self.xorg.xcbutil + ] ++ self.lib.remove self.xorg.libXinerama ( + self.lib.remove self.pcre oldAttrs.buildInputs + ); + src = git-ignore-nix.lib.gitignoreSource ./.; + }); + }; + pkgs = import nixpkgs { inherit system overlays; config.allowBroken = true; }; + overlays = [ overlay ]; + in rec { + inherit overlay overlays; + defaultPackage = pkgs.picom; + devShell = defaultPackage.overrideAttrs { + buildInputs = defaultPackage.buildInputs ++ [ + pkgs.clang-tools + ]; + }; + }); +}