From e5a274cc71cecb2210c90cb51894f258ac15c47d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 15 Mar 2024 13:22:15 +0100 Subject: [PATCH] flakify --- .nixignore | 2 ++ flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 31 +++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 .nixignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.nixignore b/.nixignore new file mode 100644 index 0000000000..2d6cedcb70 --- /dev/null +++ b/.nixignore @@ -0,0 +1,2 @@ +*.nix +flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..a3c50638bb --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1710272261, + "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "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 0000000000..3b4a77da09 --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "i3-compatible Wayland compositor"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + sway-unwrapped = pkgs.sway-unwrapped.overrideAttrs ( + previous: { + src = pkgs.nix-gitignore.gitignoreSource [ ./.nixignore ] ./.; + } + ); + sway = pkgs.sway.override {sway-unwrapped=sway-unwrapped;}; + in + { + packages.default = sway; + devShells.default = pkgs.mkShell { inputsFrom = [ sway ]; }; + } + ); +}