From 93c88791a1d41f45087a8958a15bbba1ce2be74e Mon Sep 17 00:00:00 2001 From: Martin Potier Date: Wed, 7 Dec 2022 14:58:01 +0200 Subject: [PATCH] Flakify xmonad --- .envrc | 1 + flake.lock | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.nix | 19 +++++++++++++++++++ shell.nix | 15 +++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..695e33e --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1670242877, + "narHash": "sha256-jBLh7dRHnbfvPPA9znOC6oQfKrCPJ0El8Zoe0BqnCjQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6e51c97f1c849efdfd4f3b78a4870e6aa2da4198", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..31c4e8e --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "Build my xmonad config"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + devShells.default = import ./shell.nix { inherit pkgs; }; + }) // { + packages.x86_64-linux.default = + # Notice the reference to nixpkgs here. + with import nixpkgs { system = "x86_64-linux"; }; + haskellPackages.callCabal2nix "xmonad-config" ./. {}; + }; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..7adb3d9 --- /dev/null +++ b/shell.nix @@ -0,0 +1,15 @@ +{ pkgs }: +let + inherit (pkgs) callPackage fetchFromGitHub mkShell; + easy-hls-src = fetchFromGitHub { + owner = "jkachmar"; + repo = "easy-hls-nix"; + rev = "291cf77f512a7121bb6801cde35ee1e8b7287f91"; + sha256 = "1bvbcp9zwmh53sm16ycp8phhc6vzc72a71sf0bvyjgfbn6zp68bc"; + }; + easy-hls = callPackage easy-hls-src {}; +in + +mkShell { + buildInputs = [ easy-hls ]; +}