first attempt at flakes

pull/1/head
Tudor Roman 2022-01-18 12:40:11 +01:00
parent dcffc60109
commit 8c40a2c048
No known key found for this signature in database
GPG Key ID: 5AFEDD03CA5A1EA4
13 changed files with 246 additions and 417 deletions

View File

@ -1,18 +1,11 @@
{ options, config, lib, pkgs, ... }:
let
sources = import ./nix/sources.nix;
cfg = config.tudor;
cfgEraseRoot = config.tudor.system.eraseRoot;
in
with lib; {
imports = [
"${sources.home-manager}/nixos"
#<home-manager/nixos>
./modules
./machines/current
./cachix.nix
];
@ -45,8 +38,8 @@ with lib; {
keyMap = "us";
};
nixpkgs.overlays = import ./packages;
nixpkgs.config.allowUnfree = true;
#nixpkgs.overlays = import ./packages;
#nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
bind

169
flake.lock Normal file
View File

@ -0,0 +1,169 @@
{
"nodes": {
"emacs-overlay": {
"locked": {
"lastModified": 1642502473,
"narHash": "sha256-G0pZzV8HzAxc18iXQGEyLu+vc5izyFByNHnEpMlC5c0=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "04773b0d39f684f33b97994b598e10631b1abe82",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "emacs-overlay",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1639871969,
"narHash": "sha256-6feWUnMygRzA9tzkrfAzpA5/NBYg75bkFxnqb1DtD7E=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "697cc8c68ed6a606296efbbe9614c32537078756",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-21.11",
"repo": "home-manager",
"type": "github"
}
},
"nix-ld": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1637574694,
"narHash": "sha256-UHYvqGnsU4h5/Kt3gbiRbaMcN7hJ8u7ey8t4qO8maUI=",
"owner": "Mic92",
"repo": "nix-ld",
"rev": "6faa38511602d9c1c5ae44eaa0fc531e4b657576",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "nix-ld",
"type": "github"
}
},
"nixos-hardware": {
"locked": {
"lastModified": 1641965797,
"narHash": "sha256-AfxfIzAZbt9aAzpVBn0Bwhd/M4Wix7G91kEjm9H6FPo=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "87a35a0d58f546dc23f37b4f6af575d0e4be6a7a",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1642190797,
"narHash": "sha256-cxeEEAtfIACnm8sV1oz0xlNp9IVk10Fxcc09ggoEZuo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3ddd960a3b575bf3230d0e59f42614b71f9e0db9",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1642130244,
"narHash": "sha256-/5FhZkZFQCRQIRFosUQW1zmDrsNHVOJIB/+XgRPHiPU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "bc59ba15b64d0a0ee1d1764f18b4f3480d2c3e5a",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"emacs-overlay": "emacs-overlay",
"home-manager": "home-manager",
"nix-ld": "nix-ld",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"utils": "utils_2"
}
},
"utils": {
"locked": {
"lastModified": 1610051610,
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"inputs": {
"flake-utils": "flake-utils"
},
"locked": {
"lastModified": 1639385028,
"narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "be1be083af014720c14f3b574f57b6173b4915d0",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

60
flake.nix Normal file
View File

@ -0,0 +1,60 @@
{
description = "My config";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-21.11;
nixpkgs-unstable.url = github:nixos/nixpkgs/nixpkgs-unstable;
utils.url = github:gytis-ivaskevicius/flake-utils-plus;
home-manager = {
url = github:nix-community/home-manager/release-21.11;
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay.url = github:nix-community/emacs-overlay;
nixos-hardware.url = github:nixos/nixos-hardware;
nix-ld.url = github:Mic92/nix-ld;
nix-ld.inputs.nixpkgs.follows = "nixpkgs";
};
nixConfig = {
substituters = [ "https://cache.nixos.org" "https://nix-community.cachix.org" ];
trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
};
outputs = inputs@{ self, utils, nixpkgs, nixpkgs-unstable, home-manager,
emacs-overlay, nixos-hardware, nix-ld, ... }:
let
commonModules = [
];
in utils.lib.mkFlake {
inherit self inputs;
supportedSystems = [ "x86_64-linux" ];
channels.unstable.input = nixpkgs-unstable;
channels.nixpkgs = {
input = nixpkgs;
overlaysBuilder = channels: [
(final: prev: {
tudor = {
};
})
];
};
channelsConfig = { allowUnfree = true; };
hostDefaults.modules = [
./configuration.nix home-manager.nixosModules.home-manager nixpkgs.nixosModules.notDetected
];
hosts = {
wsl2.modules = commonModules ++ [
./machines/wsl2
nix-ld.nixosModules.nix-ld
];
};
};
}

View File

@ -1,8 +1,7 @@
{ config, lib, options, pkgs, ... }:
let
sources = import ../nix/sources.nix;
# there must be an elegant way of doing this but I don't know
hmLib = (import "${sources.home-manager}/modules/lib/stdlib-extended.nix" pkgs.lib).hm;
# hmLib = (import "${pkgs.tudor.hm}/stdlib-extended.nix" pkgs.lib).hm;
in
{
imports = [
@ -36,13 +35,14 @@ in
# changes in each release.
home.stateVersion = "20.03";
home.activation.linkStuff = hmLib.dag.entryAfter [ "writeBoundary" ] ''
test -L $HOME/.doom.d || ln -sf "${builtins.toPath ../config/doom}" "$HOME/.doom.d"
# FIXME: link folders in home
#home.activation.linkStuff = hmLib.dag.entryAfter [ "writeBoundary" ] ''
# test -L $HOME/.doom.d || ln -sf "${builtins.toPath ../config/doom}" "$HOME/.doom.d"
test -L $HOME/wallpapers || ln -sf "${builtins.toPath ../misc/wallpapers}" "$HOME/wallpapers"
# test -L $HOME/wallpapers || ln -sf "${builtins.toPath ../misc/wallpapers}" "$HOME/wallpapers"
test -L $HOME/bin || ln -sf "${builtins.toPath ../bin}" "$HOME/bin"
'';
# test -L $HOME/bin || ln -sf "${builtins.toPath ../bin}" "$HOME/bin"
#'';
};
};
}

View File

@ -1,15 +1,10 @@
{ config, lib, pkgs, ... }:
let
sources = import ../../nix/sources.nix;
in
{
imports = [ "${sources.nix-ld}/modules/nix-ld.nix" ];
environment.variables = {
NIX_LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
stdenv.cc.cc
gcc-unwrapped.lib
];
NIX_LD = builtins.readFile "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
NIX_LD = pkgs.binutils.dynamicLinker;
};
}

View File

@ -1,23 +1,7 @@
{ config, lib, pkgs, ... }:
let
sources = import ../../nix/sources.nix;
in
with import sources.nixpkgs-unstable {
overlays = [
(let
sources = import ../../nix/sources.nix;
fetchGitHubArchive = { owner, repo, rev, sha256 }: builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
inherit sha256;
};
in import (fetchGitHubArchive {
inherit (sources.emacs-overlay) owner repo rev sha256;
}))
];
};
{ inputs, config, lib, pkgs, ... }:
let
cfg = config.tudor.tools.emacs;
emacsKind = emacsPgtkGcc;
emacsKind = pkgs.emacsPgtkGcc;
in
with lib; {
options = {
@ -30,6 +14,7 @@ with lib; {
};
config = mkIf cfg.enable {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
tudor.home = {
home.packages = with pkgs; [
# doom dependencies
@ -50,7 +35,7 @@ with lib; {
libvterm
unstable.libgccjit
libgccjit
];
programs.emacs = {

View File

@ -17,7 +17,8 @@
};
extraConfig = {
credential.helper = "!bw-git-helper $@";
# FIXME: bit bitwarden credential helper
#credential.helper = "!bw-git-helper $@";
diff.algorithm = "patience";
tag.forceSignAnnotated = true;
};
@ -33,7 +34,7 @@
'';
home.packages = with pkgs; [
tudor.bw-git-helper
#tudor.bw-git-helper
git-lfs
];
};

View File

@ -1,122 +0,0 @@
{
"blog": {
"branch": "master",
"description": "My blog!",
"homepage": null,
"owner": "tudurom",
"repo": "blog",
"rev": "f21df26d8924e221b0c0477b3e29bdfd6e144db7",
"sha256": "16k3zd6xg22abwl140n0dkiyd4zamxyaw02dk89343m5iwx06ans",
"type": "tarball",
"url": "https://github.com/tudurom/blog/archive/f21df26d8924e221b0c0477b3e29bdfd6e144db7.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"bw-git-helper": {
"branch": "master",
"description": null,
"homepage": null,
"owner": "tudurom",
"repo": "bw-git-helper",
"rev": "eeb6cbad5bf56b3bb8edc4a396f30018332a6f75",
"sha256": "02831z657a4danbk3lhzgdi9gvwqkv925mjlv7ck81adksr2ncvn",
"type": "tarball",
"url": "https://github.com/tudurom/bw-git-helper/archive/eeb6cbad5bf56b3bb8edc4a396f30018332a6f75.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"emacs-overlay": {
"branch": "master",
"description": "Bleeding edge emacs overlay [maintainer=@adisbladis] ",
"homepage": "",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "dd107bd2cf13527e58b894a4f3711cca27e0a256",
"sha256": "0yqryy1606c6ssa97isj5i2z6mzbz395ldy1x1058cggl0zdqdsz",
"type": "tarball",
"url": "https://github.com/nix-community/emacs-overlay/archive/dd107bd2cf13527e58b894a4f3711cca27e0a256.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"home-manager": {
"branch": "release-21.11",
"description": "Manage a user environment using Nix [maintainer=@rycee] ",
"homepage": "https://rycee.gitlab.io/home-manager/",
"owner": "nix-community",
"repo": "home-manager",
"rev": "93ad8661c7f2294bc7d3e509afe64f5bc05ca9b6",
"sha256": "17ysg0nm9f5m7ch5gnpw86c9wabnfszpvb7b7wk5j9xng5xa4wz9",
"type": "tarball",
"url": "https://github.com/nix-community/home-manager/archive/93ad8661c7f2294bc7d3e509afe64f5bc05ca9b6.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
"branch": "master",
"description": "Easy dependency management for Nix projects",
"homepage": "https://github.com/nmattia/niv",
"owner": "nmattia",
"repo": "niv",
"rev": "5830a4dd348d77e39a0f3c4c762ff2663b602d4c",
"sha256": "1d3lsrqvci4qz2hwjrcnd8h5vfkg8aypq3sjd4g3izbc8frwz5sm",
"type": "tarball",
"url": "https://github.com/nmattia/niv/archive/5830a4dd348d77e39a0f3c4c762ff2663b602d4c.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nix-ld": {
"branch": "main",
"description": "Run unpatched dynamic binaries on NixOS",
"homepage": "",
"owner": "Mic92",
"repo": "nix-ld",
"rev": "6faa38511602d9c1c5ae44eaa0fc531e4b657576",
"sha256": "0hk94vpshy6brggfxwj9p0vir8vdj6w82xxbziwqhlzcd6l2yxjh",
"type": "tarball",
"url": "https://github.com/Mic92/nix-ld/archive/6faa38511602d9c1c5ae44eaa0fc531e4b657576.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixos-hardware": {
"branch": "master",
"description": "A collection of NixOS modules covering hardware quirks.",
"homepage": "",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "2a7063461c3751d83869a2a0a8ebc59e34bec5b2",
"sha256": "173ms858wni43l2p7vqjarm2bnjdhpii0zgn46750nyfff1f2184",
"type": "tarball",
"url": "https://github.com/NixOS/nixos-hardware/archive/2a7063461c3751d83869a2a0a8ebc59e34bec5b2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
"branch": "release-21.11",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "76fdcfe47c9bf88a941b47e224e537c516c8d7ff",
"sha256": "12jnjb2cvvxl5vas1a1lc7jkw31nzfaaxwzkqawp48nin0c3v3ky",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/76fdcfe47c9bf88a941b47e224e537c516c8d7ff.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs-unstable": {
"branch": "nixos-unstable",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a2e281f5770247855b85d70c43454ba5bff34613",
"sha256": "03m6b3yvx7v8gwib848aclwqpg02rhqdh9h511w9byyfvha9g0fg",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a2e281f5770247855b85d70c43454ba5bff34613.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"site": {
"branch": "master",
"description": "My website",
"homepage": "https://tudorr.ro/",
"owner": "tudurom",
"repo": "site",
"rev": "63d6489d0b6f6281955a63e4b2db07a7dc0393ce",
"sha256": "00hnl9856i5bclcn078xh8grwircp0wh7w77793b4gmi5ihnib7l",
"type": "tarball",
"url": "https://github.com/tudurom/site/archive/63d6489d0b6f6281955a63e4b2db07a7dc0393ce.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

View File

@ -1,133 +0,0 @@
# This file has been generated by Niv.
let
#
# The fetchers. fetch_<type> fetches specs of type <type>.
#
fetch_file = pkgs: spec:
if spec.builtin or true then
builtins_fetchurl { inherit (spec) url sha256; }
else
pkgs.fetchurl { inherit (spec) url sha256; };
fetch_tarball = pkgs: spec:
if spec.builtin or true then
builtins_fetchTarball { inherit (spec) url sha256; }
else
pkgs.fetchzip { inherit (spec) url sha256; };
fetch_git = spec:
builtins.fetchGit {
url = spec.repo;
inherit (spec) rev ref;
};
fetch_builtin-tarball = spec:
builtins.trace ''
WARNING:
The niv type "builtin-tarball" will soon be deprecated. You should
instead use `builtin = true`.
$ niv modify <package> -a type=tarball -a builtin=true
'' builtins_fetchTarball { inherit (spec) url sha256; };
fetch_builtin-url = spec:
builtins.trace ''
WARNING:
The niv type "builtin-url" will soon be deprecated. You should
instead use `builtin = true`.
$ niv modify <package> -a type=file -a builtin=true
'' (builtins_fetchurl { inherit (spec) url sha256; });
#
# Various helpers
#
# The set of packages used when specs are fetched using non-builtins.
mkPkgs = sources:
let
sourcesNixpkgs =
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; })
{ };
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
in if builtins.hasAttr "nixpkgs" sources then
sourcesNixpkgs
else if hasNixpkgsPath && !hasThisAsNixpkgsPath then
import <nixpkgs> { }
else
abort ''
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
add a package called "nixpkgs" to your sources.json.
'';
# The actual fetching function.
fetch = pkgs: name: spec:
if !builtins.hasAttr "type" spec then
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
else if spec.type == "file" then
fetch_file pkgs spec
else if spec.type == "tarball" then
fetch_tarball pkgs spec
else if spec.type == "git" then
fetch_git spec
else if spec.type == "builtin-tarball" then
fetch_builtin-tarball spec
else if spec.type == "builtin-url" then
fetch_builtin-url spec
else
abort
"ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
# Ports of functions for older nix versions
# a Nix version of mapAttrs if the built-in doesn't exist
mapAttrs = builtins.mapAttrs or (f: set:
with builtins;
listToAttrs (map (attr: {
name = attr;
value = f attr set.${attr};
}) (attrNames set)));
# fetchTarball version that is compatible between all the versions of Nix
builtins_fetchTarball = { url, sha256 }@attrs:
let inherit (builtins) lessThan nixVersion fetchTarball;
in if lessThan nixVersion "1.12" then
fetchTarball { inherit url; }
else
fetchTarball attrs;
# fetchurl version that is compatible between all the versions of Nix
builtins_fetchurl = { url, sha256 }@attrs:
let inherit (builtins) lessThan nixVersion fetchurl;
in if lessThan nixVersion "1.12" then
fetchurl { inherit url; }
else
fetchurl attrs;
# Create the final "sources" from the config
mkSources = config:
mapAttrs (name: spec:
if builtins.hasAttr "outPath" spec then
abort
"The values in sources.json should not have an 'outPath' attribute"
else
spec // { outPath = fetch config.pkgs name spec; }) config.sources;
# The "config" used by the fetchers
mkConfig = { sourcesFile ? ./sources.json
, sources ? builtins.fromJSON (builtins.readFile sourcesFile)
, pkgs ? mkPkgs sources }: rec {
# The sources, i.e. the attribute set of spec name to spec
inherit sources;
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
inherit pkgs;
};
in mkSources (mkConfig { }) // {
__functor = _: settings: mkSources (mkConfig settings);
}

View File

@ -1,27 +0,0 @@
# Shamelessly stolen from https://git.knightsofthelambdacalcul.us/hazel/etc/src/branch/canon/packages/bw-git-helper.nix
{ sources ? import ../nix/sources.nix
, pkgs, lib, buildGoModule, fetchFromGitHub }:
let
spdx = lic: lic // {
url = "https://spdx.org/licenses/${lic.spdxId}.html";
};
in
buildGoModule rec {
pname = "bw-git-helper";
version = "unstable";
src = sources.bw-git-helper;
# not managed by niv
vendorSha256 = "1x7iwd4ndcvcwyx8cxhkcwn5kwwf8nam47ln743wnvcrxi7q2604";
buildInputs = with pkgs; [ bitwarden-cli ];
meta = with lib; {
description = "A git credential helper using BitWarden as a backend";
homepage = "https://github.com/tudurom/bw-git-helper";
license = spdx { spdxId = "EUPL-1.2"; };
maintainers = [ maintainers.tudor ];
platforms = platforms.all;
};
}

View File

@ -1,18 +0,0 @@
let
sources = import ../nix/sources.nix;
in
[
(self: super: with super; rec {
tudor = {
bw-git-helper = callPackage ./bw-git-helper.nix {};
rofi-wayland = callPackage ./rofi-wayland/wrapper.nix {};
site = import sources.site {};
blog = import sources.blog;
};
rofi = tudor.rofi-wayland;
unstable = import sources.nixpkgs-unstable { inherit config; };
})
]

View File

@ -1,39 +0,0 @@
{ stdenv, lib, fetchFromGitHub
, pkgconfig, libxkbcommon, pango, which, git, wayland-protocols
, cairo, libxcb, xcbutil, xcbutilwm, xcbutilxrm, libstartup_notification
, bison, flex, librsvg, check, meson, ninja, wayland }:
stdenv.mkDerivation rec {
pname = "rofi-wayland-unwrapped";
version = "unstable";
# explicitly not niv-managed due to submodules
src = fetchFromGitHub {
owner = "lbonn";
repo = "rofi";
rev = "cef94af6e1397be6bb66d123599520378cc9366f";
sha256 = "0dj7k4lvsj62l9vg01rmklhjfgvnms00vich9dgzmfwr64wxn1l9";
fetchSubmodules = true;
};
preConfigure = ''
patchShebangs "script"
# root not present in build /etc/passwd
sed -i 's/~root/~nobody/g' test/helper-expand.c
'';
nativeBuildInputs = [ meson ninja pkgconfig ];
buildInputs = [ libxkbcommon pango cairo git bison flex librsvg check
libstartup_notification libxcb xcbutil xcbutilwm xcbutilxrm which
wayland-protocols wayland
];
doCheck = false;
meta = with lib; {
description = "Window switcher, run dialog and dmenu replacement";
homepage = "https://github.com/davatorium/rofi";
license = licenses.mit;
maintainers = with maintainers; [ mbakke ];
platforms = with platforms; linux;
};
}

View File

@ -1,35 +0,0 @@
{ symlinkJoin, lib, makeWrapper, hicolor-icon-theme
, pkgs, theme ? null, plugins ? [] }:
let
rofi-wayland-unwrapped = pkgs.callPackage (import ./default.nix) {};
in symlinkJoin {
name = "rofi-wayland-${rofi-wayland-unwrapped.version}";
paths = [
rofi-wayland-unwrapped.out
] ++ (lib.forEach plugins (p: p.out));
buildInputs = [ makeWrapper ];
preferLocalBuild = true;
passthru.unwrapped = rofi-wayland-unwrapped;
postBuild = ''
rm -rf $out/bin
mkdir $out/bin
ln -s ${rofi-wayland-unwrapped}/bin/* $out/bin
rm $out/bin/rofi
makeWrapper ${rofi-wayland-unwrapped}/bin/rofi $out/bin/rofi \
--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share \
${lib.optionalString (plugins != []) ''--prefix XDG_DATA_DIRS : ${lib.concatStringsSep ":" (lib.forEach plugins (p: "${p.out}/share"))}''} \
${lib.optionalString (theme != null) ''--add-flags "-theme ${theme}"''} \
${lib.optionalString (plugins != []) ''--add-flags "-plugin-path $out/lib/rofi"''}
rm $out/bin/rofi-theme-selector
makeWrapper ${rofi-wayland-unwrapped}/bin/rofi-theme-selector $out/bin/rofi-theme-selector \
--prefix XDG_DATA_DIRS : $out/share
'';
meta = rofi-wayland-unwrapped.meta // {
priority = (rofi-wayland-unwrapped.meta.priority or 0) - 1;
};
}