feat: attempted to install an alacritty theme
This commit is contained in:
parent
44217c11c5
commit
40a6cfbc21
|
@ -20,6 +20,9 @@
|
|||
|
||||
agnoster.url = "github:oh-my-fish/theme-agnoster";
|
||||
agnoster.flake = false;
|
||||
|
||||
githubNvimTheme.url = "github:projekt0n/github-nvim-theme";
|
||||
githubNvimTheme.flake = true;
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, home-manager, ... }:
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
{ ... }: {
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
githubAlacrittyTheme =
|
||||
"${pkgs.githubNvimTheme}/terminal/alacritty/github_light.yml";
|
||||
in {
|
||||
home-manager.users.adrielus.programs.alacritty = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
import = [ githubAlacrittyTheme ];
|
||||
|
||||
window = {
|
||||
decorations = "none";
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
# fceux
|
||||
|
||||
# games
|
||||
tetrio-desktop
|
||||
# tetrio-desktop
|
||||
# mindustry
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{ system }:
|
||||
{ home-manager, nixpkgs-unstable, nixos-unstable, easy-purescript-nix
|
||||
, easy-dhall-nix, z, agnoster, ... }:
|
||||
{ home-manager, nixpkgs, nixpkgs-unstable, nixos-unstable, easy-purescript-nix
|
||||
, easy-dhall-nix, z, agnoster, githubNvimTheme, ... }:
|
||||
({ pkgs, ... }: {
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
# inherit nixos-unstable;
|
||||
|
@ -23,6 +24,11 @@
|
|||
src = agnoster;
|
||||
name = "agnoster";
|
||||
};
|
||||
|
||||
githubNvimTheme = {
|
||||
src = githubNvimTheme;
|
||||
name = "githubNvimTheme";
|
||||
};
|
||||
})
|
||||
];
|
||||
})
|
||||
|
|
|
@ -2,6 +2,7 @@ self: super:
|
|||
with self; {
|
||||
discord = unstable.discord;
|
||||
vscode = unstable.vscode;
|
||||
tetrio-desktop = unstable.tetrio-desktop;
|
||||
}
|
||||
# let version = "0.0.15";
|
||||
# in self
|
||||
|
|
134
nix/sources.json
134
nix/sources.json
|
@ -1,134 +0,0 @@
|
|||
{
|
||||
"NUR": {
|
||||
"branch": "master",
|
||||
"description": "Nix User Repository: User contributed nix packages [maintainer=@Mic92]",
|
||||
"homepage": "",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "b94538af2a15e0b1f139c72bb40ad0cfcfffb869",
|
||||
"sha256": "07mkli320qzfzv7hafkwhc1xg78d8hc2b31ny4yary52sni2bkhs",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nix-community/NUR/archive/b94538af2a15e0b1f139c72bb40ad0cfcfffb869.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"agnoster": {
|
||||
"branch": "master",
|
||||
"description": null,
|
||||
"homepage": null,
|
||||
"owner": "oh-my-fish",
|
||||
"repo": "theme-agnoster",
|
||||
"rev": "43860ce1536930bca689470e26083b0a5b7bd6ae",
|
||||
"sha256": "16k94hz3s6wayass6g1lhlcjmbpf2w8mzx90qrrqp120h80xwp25",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/oh-my-fish/theme-agnoster/archive/43860ce1536930bca689470e26083b0a5b7bd6ae.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"all-hies": {
|
||||
"branch": "master",
|
||||
"description": "Cached Haskell IDE Engine Nix builds for all GHC versions",
|
||||
"homepage": "",
|
||||
"owner": "Infinisil",
|
||||
"repo": "all-hies",
|
||||
"rev": "2364c7bdf5eec60a4765486d16f9ae6be5cd8a78",
|
||||
"sha256": "083k1xxjpdgfkbvadbw6sdbll52807iwzs1fsy1b5axjijsc5qgh",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/Infinisil/all-hies/archive/2364c7bdf5eec60a4765486d16f9ae6be5cd8a78.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"cached-nix-shell": {
|
||||
"branch": "master",
|
||||
"description": "Instant startup time for nix-shell",
|
||||
"homepage": "",
|
||||
"owner": "xzfc",
|
||||
"repo": "cached-nix-shell",
|
||||
"rev": "1955b9d0aaaf90337541ab799d5071eeaac2360c",
|
||||
"sha256": "17v38llx83mp05a0axjxcd2zyafd57syh7xhx5cq6qibcbha0by9",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/xzfc/cached-nix-shell/archive/1955b9d0aaaf90337541ab799d5071eeaac2360c.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"easy-dhall-nix": {
|
||||
"branch": "master",
|
||||
"description": "Derivations for easily downloading Dhall binaries and putting them to use.",
|
||||
"homepage": "",
|
||||
"owner": "justinwoo",
|
||||
"repo": "easy-dhall-nix",
|
||||
"rev": "9bd1bea0dcebe1d1d120c0fd1ba76683dc4a62e3",
|
||||
"sha256": "1gdx1iqhr3ih3f2v304yjnpjqydpl0x4ngrg58qa4x5wlcr5rdhl",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/justinwoo/easy-dhall-nix/archive/9bd1bea0dcebe1d1d120c0fd1ba76683dc4a62e3.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"easy-purescript-nix": {
|
||||
"branch": "master",
|
||||
"description": "Easy PureScript (and other tools) with Nix",
|
||||
"homepage": "",
|
||||
"owner": "justinwoo",
|
||||
"repo": "easy-purescript-nix",
|
||||
"rev": "82f901ce0a2d86327e2d65993a75c2ea74f229f2",
|
||||
"sha256": "0qsq8bj76y3bxdl2iphknjib139z0jw75xlaih7viv9kvfm9b1lx",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/justinwoo/easy-purescript-nix/archive/82f901ce0a2d86327e2d65993a75c2ea74f229f2.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"home-manager": {
|
||||
"branch": "release-20.03",
|
||||
"description": "Manage a user environment using Nix",
|
||||
"homepage": "https://rycee.gitlab.io/home-manager/",
|
||||
"owner": "rycee",
|
||||
"repo": "home-manager",
|
||||
"rev": "e6f96b6aa3e99495f9f6f3488ecf78dd316e5bec",
|
||||
"sha256": "1xvxqw5cldlhcl7xsbw11n2s3x1h2vmbm1b9b69a641rzj3srg11",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/rycee/home-manager/archive/e6f96b6aa3e99495f9f6f3488ecf78dd316e5bec.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"
|
||||
},
|
||||
"nixpkgs": {
|
||||
"branch": "nixos-20.03",
|
||||
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
|
||||
"homepage": "https://github.com/NixOS/nixpkgs",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs-channels",
|
||||
"rev": "6d1a044fc9ff3cc96fca5fa3ba9c158522bbf2a5",
|
||||
"sha256": "07a3nyrj3pwl017ig0rbn5rbmbf14gl3vqggvkyrdby01726p5fg",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs-channels/archive/6d1a044fc9ff3cc96fca5fa3ba9c158522bbf2a5.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": "715f63411952c86c8f57ab9e3e3cb866a015b5f2",
|
||||
"sha256": "152kxfk11mgwg8gx0s1rgykyydfb7s746yfylvbwk5mk5cv4z9nv",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/715f63411952c86c8f57ab9e3e3cb866a015b5f2.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"snack": {
|
||||
"branch": "master",
|
||||
"description": "Nix-based incremental build tool for Haskell projects",
|
||||
"homepage": "",
|
||||
"owner": "nmattia",
|
||||
"repo": "snack",
|
||||
"rev": "2c490a259a7670192744021fb87bf7e430a4e7f0",
|
||||
"sha256": "1v9b9bimw2nx0f2v94hjxlmsb7s82idrpc9dvjabqm92f9yc3kx9",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nmattia/snack/archive/2c490a259a7670192744021fb87bf7e430a4e7f0.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
}
|
||||
}
|
174
nix/sources.nix
174
nix/sources.nix
|
@ -1,174 +0,0 @@
|
|||
# This file has been generated by Niv.
|
||||
|
||||
let
|
||||
|
||||
#
|
||||
# The fetchers. fetch_<type> fetches specs of type <type>.
|
||||
#
|
||||
|
||||
fetch_file = pkgs: name: spec:
|
||||
let
|
||||
name' = sanitizeName name + "-src";
|
||||
in
|
||||
if spec.builtin or true then
|
||||
builtins_fetchurl { inherit (spec) url sha256; name = name'; }
|
||||
else
|
||||
pkgs.fetchurl { inherit (spec) url sha256; name = name'; };
|
||||
|
||||
fetch_tarball = pkgs: name: spec:
|
||||
let
|
||||
name' = sanitizeName name + "-src";
|
||||
in
|
||||
if spec.builtin or true then
|
||||
builtins_fetchTarball { name = name'; inherit (spec) url sha256; }
|
||||
else
|
||||
pkgs.fetchzip { name = name'; inherit (spec) url sha256; };
|
||||
|
||||
fetch_git = name: spec:
|
||||
let
|
||||
ref =
|
||||
if spec ? ref then spec.ref else
|
||||
if spec ? branch then "refs/heads/${spec.branch}" else
|
||||
if spec ? tag then "refs/tags/${spec.tag}" else
|
||||
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
|
||||
in
|
||||
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; };
|
||||
|
||||
fetch_local = spec: spec.path;
|
||||
|
||||
fetch_builtin-tarball = name: throw
|
||||
''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`.
|
||||
$ niv modify ${name} -a type=tarball -a builtin=true'';
|
||||
|
||||
fetch_builtin-url = name: throw
|
||||
''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`.
|
||||
$ niv modify ${name} -a type=file -a builtin=true'';
|
||||
|
||||
#
|
||||
# Various helpers
|
||||
#
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/pull/83241/files#diff-c6f540a4f3bfa4b0e8b6bafd4cd54e8bR695
|
||||
sanitizeName = name:
|
||||
(
|
||||
concatMapStrings (s: if builtins.isList s then "-" else s)
|
||||
(
|
||||
builtins.split "[^[:alnum:]+._?=-]+"
|
||||
((x: builtins.elemAt (builtins.match "\\.*(.*)" x) 0) name)
|
||||
)
|
||||
);
|
||||
|
||||
# The set of packages used when specs are fetched using non-builtins.
|
||||
mkPkgs = sources: system:
|
||||
let
|
||||
sourcesNixpkgs =
|
||||
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) { inherit system; };
|
||||
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 name spec
|
||||
else if spec.type == "tarball" then fetch_tarball pkgs name spec
|
||||
else if spec.type == "git" then fetch_git name spec
|
||||
else if spec.type == "local" then fetch_local spec
|
||||
else if spec.type == "builtin-tarball" then fetch_builtin-tarball name
|
||||
else if spec.type == "builtin-url" then fetch_builtin-url name
|
||||
else
|
||||
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
|
||||
|
||||
# If the environment variable NIV_OVERRIDE_${name} is set, then use
|
||||
# the path directly as opposed to the fetched source.
|
||||
replace = name: drv:
|
||||
let
|
||||
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
|
||||
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
|
||||
in
|
||||
if ersatz == "" then drv else
|
||||
# this turns the string into an actual Nix path (for both absolute and
|
||||
# relative paths)
|
||||
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
|
||||
|
||||
# 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))
|
||||
);
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295
|
||||
range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1);
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257
|
||||
stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1));
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269
|
||||
stringAsChars = f: s: concatStrings (map f (stringToCharacters s));
|
||||
concatMapStrings = f: list: concatStrings (map f list);
|
||||
concatStrings = builtins.concatStringsSep "";
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331
|
||||
optionalAttrs = cond: as: if cond then as else {};
|
||||
|
||||
# fetchTarball version that is compatible between all the versions of Nix
|
||||
builtins_fetchTarball = { url, name ? null, sha256 }@attrs:
|
||||
let
|
||||
inherit (builtins) lessThan nixVersion fetchTarball;
|
||||
in
|
||||
if lessThan nixVersion "1.12" then
|
||||
fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
||||
else
|
||||
fetchTarball attrs;
|
||||
|
||||
# fetchurl version that is compatible between all the versions of Nix
|
||||
builtins_fetchurl = { url, name ? null, sha256 }@attrs:
|
||||
let
|
||||
inherit (builtins) lessThan nixVersion fetchurl;
|
||||
in
|
||||
if lessThan nixVersion "1.12" then
|
||||
fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; }))
|
||||
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 = replace name (fetch config.pkgs name spec); }
|
||||
) config.sources;
|
||||
|
||||
# The "config" used by the fetchers
|
||||
mkConfig =
|
||||
{ sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null
|
||||
, sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile)
|
||||
, system ? builtins.currentSystem
|
||||
, pkgs ? mkPkgs sources system
|
||||
}: 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); }
|
Loading…
Reference in a new issue