cleanup, and move automapaper to flake

This commit is contained in:
Noa Aarts 2024-03-13 00:26:08 +01:00
parent d71f3aa179
commit 6acc907490
9 changed files with 35 additions and 196 deletions

View file

@ -1,8 +1,8 @@
{ config, pkgs, inputs, ... }:
{ config, inputs, pkgs, ... }:
{
home.packages = with pkgs; [
(callPackage ../../custom/automapaper/default.nix { })
home.packages = [
inputs.automapaper.packages.${pkgs.system}.default
];
home.file = {

View file

@ -30,7 +30,7 @@
base0F = "#AAAAAA";
text = "#222222";
textInverted = "#DDDDDD";
textMuted = "#5F5F5F";
textMuted = "#DDDDDD";
background = "#FFD2D2";
backgroundMuted = "#CCCCCC";
warn = "#FF0000";
@ -38,7 +38,7 @@
danger = "#F53C3C";
succes = "#5BBD63";
spotifyGreen = "#39A04A";
border = "#DDDDDD";
border = "#5F5F5F";
info = "#2CB6AF";
ok = "#38B148";
};

View file

@ -1,57 +0,0 @@
{
lib
, stdenv
, fetchgit
, meson
, ninja
, pkg-config
, pacman
, libarchive
, wayland
, libGL
}:
stdenv.mkDerivation rec {
pname = "automapaper";
version = "unstable-2022-05-15";
src = fetchgit {
url = "https://github.com/itepastra/automapaper";
rev = "f102526244d954a4e4ae30a4b11f070e821f66ec";
sha256 = "sha256-WyD8NlA6T0v0ixMpN67Tro1Cy06rmx2FDaf5qriiFQA=";
};
meta = with lib; {
description = "based animated wallpaper for wlroots";
homepage = "https://github.com/itepastra/automapaper";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ itepastra ];
};
nativeBuildInputs = [
meson
ninja
pkg-config
pacman
libarchive
];
buildInputs = [
wayland
libGL
];
configurePhase = ''
meson setup build
'';
buildPhase = ''
ninja -C build
'';
installPhase = ''
mkdir -p $out/bin
mv build/automapaper $out/bin
'';
}

View file

@ -1,12 +0,0 @@
{ nixpkgs-lib, ... }: rec {
lib-core = import ./lib/core { inherit nixpkgs-lib; };
lib = lib-core // { contrib = lib-contrib; };
homeManagerModules = rec {
colorScheme = import ./module;
# Alias
colorscheme = colorScheme;
default = colorScheme;
};
homeManagerModule = homeManagerModules.colorScheme;
}

View file

@ -1,13 +0,0 @@
{
description =
"a home-manager module to make theming easier.";
inputs = {
nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
};
outputs = { self, nixpkgs-lib, color-schemes }:
import ./. {
nixpkgs-lib = nixpkgs-lib.lib;
};
}

View file

@ -1,104 +0,0 @@
{ lib, config, ... }:
with lib;
let
cfg = config.colorScheme;
hexColorType = mkOptionType {
name = "hex-color";
descriptionClass = "noun";
description = "RGB color in hex format";
check = x: isString x && !(hasPrefix "#" x);
};
in
{
imports = [
(mkAliasOptionModule [ "colorscheme" ] [ "colorScheme" ])
(mkRenamedOptionModule [ "colorScheme" "kind" ] [ "colorScheme" "variant" ])
(mkRenamedOptionModule [ "colorScheme" "colors" ] [ "colorScheme" "palette" ])
];
options.colorScheme = {
slug = mkOption {
type = types.str;
example = "awesome-scheme";
description = ''
Color scheme slug (sanitized name)
'';
};
name = mkOption {
type = types.str;
default = "";
example = "Awesome Scheme";
description = ''
Color scheme (pretty) name
'';
};
description = mkOption {
type = types.str;
default = "";
example = "A very nice theme";
description = ''
Color scheme description
'';
};
author = mkOption {
type = types.str;
default = "";
example = "Gabriel Fontes (https://m7.rs)";
description = ''
Color scheme author
'';
};
variant = mkOption {
type = types.enum [ "dark" "light" ];
default =
if builtins.substring 0 1 cfg.palette.base00 < "5" then
"dark"
else
"light";
description = ''
Whether the scheme is dark or light
'';
};
palette = mkOption {
type = with types; attrsOf (
coercedTo str (removePrefix "#") hexColorType
);
default = { };
example = literalExpression ''
{
base00 = "002635";
base01 = "00384d";
base02 = "517F8D";
base03 = "6C8B91";
base04 = "869696";
base05 = "a1a19a";
base06 = "e6e6dc";
base07 = "fafaf8";
base08 = "ff5a67";
base09 = "f08e48";
base0A = "ffcc1b";
base0B = "7fc06e";
base0C = "14747e";
base0D = "5dd7b9";
base0E = "9a70a4";
base0F = "c43060";
}
'';
description = ''
Atribute set of hex colors.
These are usually base00-base0F, but you may use any name you want.
For example, these can have meaningful names (bg, fg), or be base24.
The colorschemes provided by nix-colors follow the base16 standard.
Some might leverage base24 and have 24 colors, but these can be safely
used as if they were base16.
You may include a leading #, but it will be stripped when accessed from
config.colorscheme.palette.
'';
};
};
}

View file

@ -1 +0,0 @@
{ imports = [ ./colorscheme.nix ]; }

21
flake.lock generated
View file

@ -1,5 +1,25 @@
{
"nodes": {
"automapaper": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1710284650,
"narHash": "sha256-iHQPVC/DgdwDJ/Ugy+Ey0B/uB6N2by+CcrGi77MkbdU=",
"owner": "itepastra",
"repo": "automapaper",
"rev": "9067c1615278a97e0d92f34a8cdbe9dda2f7e6a7",
"type": "github"
},
"original": {
"owner": "itepastra",
"repo": "automapaper",
"type": "github"
}
},
"base16-schemes": {
"flake": false,
"locked": {
@ -315,6 +335,7 @@
},
"root": {
"inputs": {
"automapaper": "automapaper",
"home-manager": "home-manager",
"nix-colors": "nix-colors",
"nixpkgs": "nixpkgs",

View file

@ -20,20 +20,25 @@
inputs.nixpkgs.follows = "nixpkgs";
};
automapaper = {
url = "github:itepastra/automapaper";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nix-colors, ... }@inputs:
outputs = { self, nixpkgs, nix-colors, automapaper, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
nixosConfigurations = {
default = nixpkgs.lib.nixosSystem {
specialArgs = {
specialArgs = {
inherit inputs;
inherit nix-colors;
inherit automapaper;
};
modules = [
./hosts/default/configuration.nix
@ -41,7 +46,7 @@
];
};
vnc = nixpkgs.lib.nixosSystem {
specialArgs = {
specialArgs = {
inherit inputs;
inherit nix-colors;
};