mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 00:18:59 +00:00
Update the config
This commit is contained in:
parent
ef12c29f36
commit
0337611eb1
19
Makefile
19
Makefile
@ -3,21 +3,18 @@ HOST := zilch
|
|||||||
HOME := /home/$(USER)
|
HOME := /home/$(USER)
|
||||||
DOTS := /etc/dotfiles
|
DOTS := /etc/dotfiles
|
||||||
|
|
||||||
NIXOS_VERSION := 20.09
|
NIXOS_VERSION := 20.09
|
||||||
NIXOS_PREFIX := $(PREFIX)/etc/nixos
|
NIXOS_PREFIX := $(PREFIX)/etc/nixos
|
||||||
FLAGS := -I "config=$$(pwd)/config" \
|
FLAGS := -I "config=$$(pwd)/config" \
|
||||||
-I "modules=$$(pwd)/modules" \
|
-I "modules=$$(pwd)/modules" \
|
||||||
-I "bin=$$(pwd)/bin" \
|
-I "bin=$$(pwd)/bin" \
|
||||||
$(FLAGS)
|
$(FLAGS)
|
||||||
|
|
||||||
config: $(NIXOS_PREFIX)/configuration.nix
|
|
||||||
home: $(HOME)/dotfiles
|
|
||||||
|
|
||||||
# The channels will be used on certain modules like in `packages/default.nix` where it will be referred to install certain packages from the unstable channel.
|
# The channels will be used on certain modules like in `packages/default.nix` where it will be referred to install certain packages from the unstable channel.
|
||||||
channels:
|
channels:
|
||||||
@sudo nix-channel --add "https://nixos.org/channels/nixos-unstable" nixos
|
@sudo nix-channel --add "https://nixos.org/channels/nixos-unstable" nixos
|
||||||
@sudo nix-channel --add "https://github.com/rycee/home-manager/archive/master.tar.gz" home-manager
|
@sudo nix-channel --add "https://github.com/rycee/home-manager/archive/master.tar.gz" home-manager
|
||||||
@sudo nix-channel --add "https://nixos.org/channels/nixpkgs-unstable" nixpkgs-unstable
|
@sudo nix-channel --add "https://nixos.org/channels/nixpkgs-unstable" nixpkgs
|
||||||
|
|
||||||
update:
|
update:
|
||||||
@sudo nix-channel --update
|
@sudo nix-channel --update
|
||||||
@ -29,11 +26,13 @@ switch:
|
|||||||
boot:
|
boot:
|
||||||
@sudo nixos-rebuild $(FLAGS) boot
|
@sudo nixos-rebuild $(FLAGS) boot
|
||||||
|
|
||||||
|
# A little bootstrapping script.
|
||||||
install: channels update
|
install: channels update
|
||||||
@sudo nixos-generate-config --root "$(PREFIX)"
|
@sudo nixos-generate-config --root "$(PREFIX)"
|
||||||
@echo "import \"$(DOTS)\" \"$(HOST)\" \"$${USER}\"" | sudo tee "${NIXOS_PREFIX}/configuration.nix"
|
@echo "import \"$$(pwd)\" \"$(HOST)\" \"$${USER}\"" | sudo tee "${NIXOS_PREFIX}/configuration.nix"
|
||||||
@sudo nixos-install --root "$(PREFIX)" $(FLAGS)
|
@sudo nixos-install --root "$(PREFIX)" $(FLAGS)
|
||||||
@sudo cp -r "$(DOTS)" "$(PREFIX)/etc/dotfiles"
|
@sudo cp -r "$(DOTS)" "$(PREFIX)/$(DOTS)"
|
||||||
|
@echo "import \"$(DOTS)\" \"$(HOST)\" \"$${USER}\"" | sudo tee "${NIXOS_PREFIX}/configuration.nix"
|
||||||
@sudo nixos-enter --root "$(PREFIX)" --command "chown $(USER):users $(DOTS) --recursive"
|
@sudo nixos-enter --root "$(PREFIX)" --command "chown $(USER):users $(DOTS) --recursive"
|
||||||
@sudo nixos-enter --root "$(PREFIX)" --command "make -C $(DOTS) channels"
|
@sudo nixos-enter --root "$(PREFIX)" --command "make -C $(DOTS) channels"
|
||||||
@echo "Set password for $(USER)" && sudo nixos-enter --root "$(PREFIX)" --command "passwd $(USER)"
|
@echo "Set password for $(USER)" && sudo nixos-enter --root "$(PREFIX)" --command "passwd $(USER)"
|
||||||
@ -44,7 +43,7 @@ clean:
|
|||||||
upgrade: update switch
|
upgrade: update switch
|
||||||
|
|
||||||
rollback:
|
rollback:
|
||||||
@sudo nix-env --rollback
|
@sudo nixos-rebuild switch $(FLAGS) --rollback
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@nixos-rebuild $(FLAGS) test
|
@nixos-rebuild $(FLAGS) test
|
||||||
|
@ -15,8 +15,8 @@ You can replace your NixOS configuration with this bad boi.
|
|||||||
To install, you have to do the following first:
|
To install, you have to do the following first:
|
||||||
|
|
||||||
- Set up your partitions.
|
- Set up your partitions.
|
||||||
- Copy this setup (either with `git` or what-have-you) to `/etc/dotfiles`.
|
- Copy this setup (either with `git` or what-have-you) in whatever location you prefer.
|
||||||
- Install GNU Make.
|
- Install GNU Make (i.e., `nix-env -i gnumake`).
|
||||||
|
|
||||||
Then simply run `make install`.
|
Then simply run `make install`.
|
||||||
It is equivalent to the following command:
|
It is equivalent to the following command:
|
||||||
@ -67,6 +67,7 @@ The project structure should look like the following:
|
|||||||
nixos-config
|
nixos-config
|
||||||
├── config/
|
├── config/
|
||||||
├── hosts/
|
├── hosts/
|
||||||
|
├── lib/
|
||||||
├── modules/
|
├── modules/
|
||||||
├── packages/
|
├── packages/
|
||||||
├── templates/
|
├── templates/
|
||||||
@ -92,6 +93,8 @@ In this case, it is my https://github.com/foo-dogsquared/dotflies[dotfiles] dire
|
|||||||
It is also used on the installation phase (from `make install`) by setting the `HOST` variable (i.e., `HOST=zilch make -C /etc/install`) with the folder name as the argument.
|
It is also used on the installation phase (from `make install`) by setting the `HOST` variable (i.e., `HOST=zilch make -C /etc/install`) with the folder name as the argument.
|
||||||
See the <<Hosts>> section for more details.
|
See the <<Hosts>> section for more details.
|
||||||
|
|
||||||
|
* A little library in link:./lib[`./lib`] based from https://github.com/hlissner/dotfiles[original source] which being used for various uses (e.g., limiting certain modules).
|
||||||
|
|
||||||
* Though my custom packages are now placed in my https://github.com/foo-dogsquared/nur-packages[NUR repo], the `packages/` folder still exists here intended for "private" packages.
|
* Though my custom packages are now placed in my https://github.com/foo-dogsquared/nur-packages[NUR repo], the `packages/` folder still exists here intended for "private" packages.
|
||||||
Also contains third-party package repositories and overlays such as the https://github.com/nix-community/NUR[NUR], https://github.com/nix-community/emacs-overlay[unstable branch of Emacs], or the unstable branch of https://github.com/NixOS/nixpkgs/[nixpkgs].
|
Also contains third-party package repositories and overlays such as the https://github.com/nix-community/NUR[NUR], https://github.com/nix-community/emacs-overlay[unstable branch of Emacs], or the unstable branch of https://github.com/NixOS/nixpkgs/[nixpkgs].
|
||||||
See the <<Packages>> section for more information.
|
See the <<Packages>> section for more information.
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#
|
#
|
||||||
# This is ground zero, where the absolute essentials go, to be present on all systems I use nixos on.
|
# This is ground zero, where the absolute essentials go, to be present on all systems I use nixos on.
|
||||||
# Contains cluser-wide configurations shared between all of the systems (located in `hosts/`).
|
# Contains cluser-wide configurations shared between all of the systems (located in `hosts/`).
|
||||||
|
# TODO: Convert into a flake-based configuration so it'll make my life easier.
|
||||||
|
|
||||||
device: username:
|
device: username:
|
||||||
{ pkgs, options, lib, config, ... }:
|
{ pkgs, options, lib, config, ... }:
|
||||||
|
@ -13,6 +13,9 @@ path = .password-store
|
|||||||
# My SSH keys
|
# My SSH keys
|
||||||
path = .ssh
|
path = .ssh
|
||||||
|
|
||||||
|
# My Cachix signing key
|
||||||
|
path = .config/cachix
|
||||||
|
|
||||||
# Some regexps specifying names and paths to ignore
|
# Some regexps specifying names and paths to ignore
|
||||||
ignore = Name temp.*
|
ignore = Name temp.*
|
||||||
ignore = Name *~
|
ignore = Name *~
|
||||||
|
@ -3,6 +3,18 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
|
"spidermonkey-38.8.0"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Set the Nix package manager to use the unstable version for flakes.
|
||||||
|
nix = {
|
||||||
|
package = pkgs.nixUnstable;
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
26
lib/attrs.nix
Executable file
26
lib/attrs.nix
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
|
with lib;
|
||||||
|
rec {
|
||||||
|
# attrsToList
|
||||||
|
attrsToList = attrs:
|
||||||
|
mapAttrsToList (name: value: { inherit name value; }) attrs;
|
||||||
|
|
||||||
|
# mapFilterAttrs ::
|
||||||
|
# (name -> value -> bool)
|
||||||
|
# (name -> value -> { name = any; value = any; })
|
||||||
|
# attrs
|
||||||
|
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
|
||||||
|
|
||||||
|
# Generate an attribute set by mapping a function over a list of values.
|
||||||
|
genAttrs' = values: f: listToAttrs (map f values);
|
||||||
|
|
||||||
|
# anyAttrs :: (name -> value -> bool) attrs
|
||||||
|
anyAttrs = pred: attrs:
|
||||||
|
any (attr: pred attr.name attr.value) (attrsToList attrs);
|
||||||
|
|
||||||
|
# countAttrs :: (name -> value -> bool) attrs
|
||||||
|
countAttrs = pred: attrs:
|
||||||
|
count (attr: pred attr.name attr.value) (attrsToList attrs);
|
||||||
|
}
|
18
lib/default.nix
Executable file
18
lib/default.nix
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
{ lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) makeExtensible attrValues foldr;
|
||||||
|
inherit (modules) mapModules;
|
||||||
|
|
||||||
|
modules = import ./modules.nix {
|
||||||
|
inherit lib;
|
||||||
|
self.attrs = import ./attrs.nix { inherit lib; self = {}; };
|
||||||
|
};
|
||||||
|
|
||||||
|
mylib = makeExtensible (self:
|
||||||
|
with self; mapModules (toString ./.)
|
||||||
|
(file: import file { inherit self lib pkgs; }));
|
||||||
|
in
|
||||||
|
mylib.extend
|
||||||
|
(self: super:
|
||||||
|
foldr (a: b: a // b) {} (attrValues super))
|
53
lib/modules.nix
Executable file
53
lib/modules.nix
Executable file
@ -0,0 +1,53 @@
|
|||||||
|
{ self, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (builtins) attrValues readDir pathExists concatLists;
|
||||||
|
inherit (lib) id mapAttrsToList filterAttrs hasPrefix hasSuffix nameValuePair removeSuffix;
|
||||||
|
inherit (self.attrs) mapFilterAttrs;
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
mapModules = dir: fn:
|
||||||
|
mapFilterAttrs
|
||||||
|
(n: v:
|
||||||
|
v != null &&
|
||||||
|
!(hasPrefix "_" n))
|
||||||
|
(n: v:
|
||||||
|
let path = "${toString dir}/${n}"; in
|
||||||
|
if v == "directory" && pathExists "${path}/default.nix"
|
||||||
|
then nameValuePair n (fn path)
|
||||||
|
else if v == "regular" &&
|
||||||
|
n != "default.nix" &&
|
||||||
|
hasSuffix ".nix" n
|
||||||
|
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||||
|
else nameValuePair "" null)
|
||||||
|
(readDir dir);
|
||||||
|
|
||||||
|
mapModules' = dir: fn:
|
||||||
|
attrValues (mapModules dir fn);
|
||||||
|
|
||||||
|
mapModulesRec = dir: fn:
|
||||||
|
mapFilterAttrs
|
||||||
|
(n: v:
|
||||||
|
v != null &&
|
||||||
|
!(hasPrefix "_" n))
|
||||||
|
(n: v:
|
||||||
|
let path = "${toString dir}/${n}"; in
|
||||||
|
if v == "directory"
|
||||||
|
then nameValuePair n (mapModulesRec path fn)
|
||||||
|
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
|
||||||
|
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||||
|
else nameValuePair "" null)
|
||||||
|
(readDir dir);
|
||||||
|
|
||||||
|
mapModulesRec' = dir: fn:
|
||||||
|
let
|
||||||
|
dirs =
|
||||||
|
mapAttrsToList
|
||||||
|
(k: _: "${dir}/${k}")
|
||||||
|
(filterAttrs
|
||||||
|
(n: v: v == "directory" && !(hasPrefix "_" n))
|
||||||
|
(readDir dir));
|
||||||
|
files = attrValues (mapModules dir id);
|
||||||
|
paths = files ++ concatLists (map (d: mapModulesRec' d id) dirs);
|
||||||
|
in map fn paths;
|
||||||
|
}
|
18
lib/options.nix
Executable file
18
lib/options.nix
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
mkOpt = type: default:
|
||||||
|
mkOption { inherit type default; };
|
||||||
|
|
||||||
|
mkOpt' = type: default: description:
|
||||||
|
mkOption { inherit type default description; };
|
||||||
|
|
||||||
|
mkBoolOpt = default: mkOption {
|
||||||
|
inherit default;
|
||||||
|
type = types.bool;
|
||||||
|
example = true;
|
||||||
|
};
|
||||||
|
}
|
@ -21,7 +21,6 @@ in {
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
# Enable JACK for the most serious audio applications.
|
# Enable JACK for the most serious audio applications.
|
||||||
services.jack = {
|
services.jack = {
|
||||||
alsa.enable = true;
|
|
||||||
jackd.enable = true;
|
jackd.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -55,7 +54,7 @@ in {
|
|||||||
] else []);
|
] else []);
|
||||||
|
|
||||||
# Required when enabling JACK daemon.
|
# Required when enabling JACK daemon.
|
||||||
my.user.extraGroups = [ "jackaudio" ];
|
my.user.extraGroups = [ "audio" "jackaudio" ];
|
||||||
|
|
||||||
# Add the sequencer and the MIDI kernel module.
|
# Add the sequencer and the MIDI kernel module.
|
||||||
boot.kernelModules = [ "snd-seq" "snd-rawmidi" ];
|
boot.kernelModules = [ "snd-seq" "snd-rawmidi" ];
|
||||||
|
@ -19,8 +19,9 @@ in {
|
|||||||
(recoll.override {
|
(recoll.override {
|
||||||
withGui = false;
|
withGui = false;
|
||||||
}) # Bring the search engine to the desktop!
|
}) # Bring the search engine to the desktop!
|
||||||
unison
|
unison # Back those files up, son.
|
||||||
magic-wormhole # Magically transfer stuff between your wormholes!
|
magic-wormhole # Magically transfer stuff between your wormholes!
|
||||||
|
oneshot # Basically `python -m http.server` that can deliver files to various devices.
|
||||||
qbittorrent # Free version of uBittorrent.
|
qbittorrent # Free version of uBittorrent.
|
||||||
xfce.thunar # A graphical file manager.
|
xfce.thunar # A graphical file manager.
|
||||||
xfce.thunar-volman # A Thunar plugin on volume management for external devices.
|
xfce.thunar-volman # A Thunar plugin on volume management for external devices.
|
||||||
|
@ -13,7 +13,7 @@ with lib;
|
|||||||
config = mkIf config.modules.desktop.fonts.enable {
|
config = mkIf config.modules.desktop.fonts.enable {
|
||||||
# Enable fontconfig to easily discover fonts installed from home-manager.
|
# Enable fontconfig to easily discover fonts installed from home-manager.
|
||||||
fonts = {
|
fonts = {
|
||||||
enableFontDir = true;
|
fontDir.enable = true;
|
||||||
enableDefaultFonts = true;
|
enableDefaultFonts = true;
|
||||||
fontconfig = {
|
fontconfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -18,6 +18,7 @@ with lib;
|
|||||||
jq # A JSON parser on the command-line (with the horrible syntax, in my opinion).
|
jq # A JSON parser on the command-line (with the horrible syntax, in my opinion).
|
||||||
pup # A cute little puppy that can understand HTML.
|
pup # A cute little puppy that can understand HTML.
|
||||||
sqlite # A cute little battle-tested library for your data abominations.
|
sqlite # A cute little battle-tested library for your data abominations.
|
||||||
|
sqlitebrowser # Skim the DB and create a quick scraping script for it.
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -25,20 +25,22 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
my.packages = with pkgs; [
|
my.packages = with pkgs; [
|
||||||
asciidoctor # An Asciidoctor document keeps a handful of few frustrated users a day.
|
asciidoctor # An Asciidoctor document keeps a handful of few frustrated users a day.
|
||||||
aspell # The not-opinionated spell checker.
|
aspell # The not-opinionated spell checker.
|
||||||
aspellDicts.en
|
aspellDicts.en
|
||||||
aspellDicts.en-computers
|
aspellDicts.en-computers
|
||||||
aspellDicts.en-science
|
aspellDicts.en-science
|
||||||
hugo # An SSG for your DDD (documentation-driven development) workflow.
|
editorconfig-core-c # A library just for formatting files?
|
||||||
languagetool # A grammar checker with a HUGE data set.
|
editorconfig-checker # Check yer formatting.
|
||||||
pandoc # The Swiss army knife for document conversion.
|
hugo # An SSG for your DDD (documentation-driven development) workflow.
|
||||||
R # Rated G for accessibility.
|
languagetool # A grammar checker with a HUGE data set.
|
||||||
vale # The customizable linter for your intended writings.
|
pandoc # The Swiss army knife for document conversion.
|
||||||
|
R # Rated G for accessibility.
|
||||||
|
vale # The customizable linter for your intended writings.
|
||||||
|
|
||||||
# TODO: Make Neuron its own package.
|
# TODO: Make Neuron its own package.
|
||||||
(let
|
(let
|
||||||
neuronRev = "2ea28ba1f023f169657a31a3cad621f1d745c606";
|
neuronRev = "e7568ca5f51609bb406a48527b5ba52d31d11f9c";
|
||||||
neuronSrc = builtins.fetchTarball "https://github.com/srid/neuron/archive/${neuronRev}.tar.gz";
|
neuronSrc = builtins.fetchTarball "https://github.com/srid/neuron/archive/${neuronRev}.tar.gz";
|
||||||
in import neuronSrc {}) # Neurons and zettels are good for the brain.
|
in import neuronSrc {}) # Neurons and zettels are good for the brain.
|
||||||
] ++
|
] ++
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.dev.go;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.modules.dev.go = {
|
options.modules.dev.go = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@ -10,7 +14,7 @@ with lib;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.modules.dev.go.enable {
|
config = mkIf cfg.enable {
|
||||||
my.packages = with pkgs; [
|
my.packages = with pkgs; [
|
||||||
delve # Wait, Go doesn't have a proper debugger?
|
delve # Wait, Go doesn't have a proper debugger?
|
||||||
go # The other zoomer proglang (READ: proglang is a zoomer term for programming language).
|
go # The other zoomer proglang (READ: proglang is a zoomer term for programming language).
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.dev.java;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.modules.dev.java = {
|
options.modules.dev.java = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@ -11,7 +15,7 @@ with lib;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.modules.dev.java.enable {
|
config = mkIf cfg.enable {
|
||||||
my.packages = with pkgs; [
|
my.packages = with pkgs; [
|
||||||
jdk # The Java Development Kit.
|
jdk # The Java Development Kit.
|
||||||
jre # The Java Runtime Environment for running Java apps.
|
jre # The Java Runtime Environment for running Java apps.
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.dev.rust;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.modules.dev.rust = {
|
options.modules.dev.rust = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@ -11,7 +15,7 @@ with lib;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.modules.dev.rust.enable {
|
config = mkIf cfg.enable {
|
||||||
my.packages = with pkgs; [
|
my.packages = with pkgs; [
|
||||||
rustup
|
rustup
|
||||||
];
|
];
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
{ config, options, lib, pkgs, ... }:
|
{ config, options, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.modules.dev.vcs;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.modules.dev.vcs = {
|
options.modules.dev.vcs = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
@ -10,7 +14,7 @@ with lib;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.modules.dev.vcs.enable {
|
config = mkIf cfg.enable {
|
||||||
my.packages = with pkgs; [
|
my.packages = with pkgs; [
|
||||||
gitAndTools.gitFull
|
gitAndTools.gitFull
|
||||||
mercurial
|
mercurial
|
||||||
|
@ -19,14 +19,15 @@ with lib;
|
|||||||
exa # ls(1) after an exodus.
|
exa # ls(1) after an exodus.
|
||||||
fd # find(1) after a cognitive behavioral therapy.
|
fd # find(1) after a cognitive behavioral therapy.
|
||||||
fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception.
|
fzf # A fuzzy finder that enables fuzzy finding not furry finding, a common misconception.
|
||||||
|
gopass # The improved version of Password Store which is a password manager for hipsters.
|
||||||
|
graphviz # The biz central for graphical flowcharts.
|
||||||
hexyl # Binary viewer with a cool name on the command-line.
|
hexyl # Binary viewer with a cool name on the command-line.
|
||||||
hledger # Do your accountancy thing ON THE COMMAND LINE, sure why not!
|
hledger # Do your accountancy thing ON THE COMMAND LINE, sure why not!
|
||||||
httpie # Want a piece of the HTTP pie.
|
httpie # Want a piece of the HTTP pie.
|
||||||
gitAndTools.tig # The Deltarune of Git.
|
|
||||||
gopass # The improved version of Password Store which is a password manager for hipsters.
|
|
||||||
graphviz # The biz central for graphical flowcharts.
|
|
||||||
maim # A command-line interface for parsing screenshots.
|
|
||||||
jq # A command-line interface for parsing JSON.
|
jq # A command-line interface for parsing JSON.
|
||||||
|
lazygit # For the lazy gits who cannot get good at Git.
|
||||||
|
lazydocker # For the lazy gits who cannot get good at Docker.
|
||||||
|
maim # A command-line interface for parsing screenshots.
|
||||||
pup # A command-line interface for parsing HTML.
|
pup # A command-line interface for parsing HTML.
|
||||||
(ripgrep.override { withPCRE2 = true; }) # Super-fast full-text searcher.
|
(ripgrep.override { withPCRE2 = true; }) # Super-fast full-text searcher.
|
||||||
(recoll.override { withGui = false; }) # Bring the search engine to the desktop!
|
(recoll.override { withGui = false; }) # Bring the search engine to the desktop!
|
||||||
|
@ -4,37 +4,15 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.modules.themes;
|
cfg = config.modules.themes;
|
||||||
|
my = import ../../lib { inherit pkgs; lib = lib; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
assertions = [{
|
||||||
|
assertion = my.countAttrs (_: x: x.enable) cfg < 2;
|
||||||
|
message = "Can't have more than one theme enabled at a time";
|
||||||
|
}];
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./fair-and-square
|
./fair-and-square
|
||||||
];
|
];
|
||||||
|
|
||||||
options.modules.themes = {
|
|
||||||
name = mkOption {
|
|
||||||
type = with types; nullOr str;
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
version = mkOption {
|
|
||||||
type = with types; nullOr str;
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
path = mkOption {
|
|
||||||
type = with types; nullOr path;
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
wallpaper = mkOption {
|
|
||||||
type = with types; nullOr path;
|
|
||||||
default = if cfg.path != null
|
|
||||||
then "${cfg.path}/config/wallpaper"
|
|
||||||
else null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf (cfg.path != null && builtins.pathExists cfg.wallpaper) {
|
|
||||||
my.home.home.file.".background-image".source = cfg.wallpaper;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
modules-left = bspwm
|
modules-left = bspwm
|
||||||
modules-center = date
|
modules-center = date
|
||||||
modules-right = pulseaudio eth memory root-fs
|
modules-right = pulseaudio eth memory root-fs home-fs
|
||||||
|
|
||||||
|
|
||||||
[module/root-fs]
|
[module/root-fs]
|
||||||
@ -73,6 +73,17 @@
|
|||||||
label-unmounted = N/A
|
label-unmounted = N/A
|
||||||
|
|
||||||
|
|
||||||
|
[module/home-fs]
|
||||||
|
type = internal/fs
|
||||||
|
mount-0 = /home/
|
||||||
|
format-mounted-prefix = ""
|
||||||
|
format-mounted-prefix-margin-right = 1
|
||||||
|
format-unmounted-prefix = ""
|
||||||
|
format-unmounted-prefix-margin-right = 1
|
||||||
|
label-mounted = %free%
|
||||||
|
label-unmounted = N/A
|
||||||
|
|
||||||
|
|
||||||
[module/bspwm]
|
[module/bspwm]
|
||||||
type = internal/bspwm
|
type = internal/bspwm
|
||||||
wrapping-scroll = false
|
wrapping-scroll = false
|
||||||
|
@ -10,13 +10,6 @@ with lib;
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.modules.themes."fair-and-square".enable {
|
config = mkIf config.modules.themes."fair-and-square".enable {
|
||||||
# Pass the metadata of the theme.
|
|
||||||
modules.theme = {
|
|
||||||
name = "Fair and square";
|
|
||||||
version = "0.1.0";
|
|
||||||
path = ./.;
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
# Enable picom compositor.
|
# Enable picom compositor.
|
||||||
picom = {
|
picom = {
|
||||||
@ -29,8 +22,6 @@ with lib;
|
|||||||
xserver = {
|
xserver = {
|
||||||
displayManager = {
|
displayManager = {
|
||||||
lightdm.enable = true;
|
lightdm.enable = true;
|
||||||
lightdm.greeters.mini.enable = true;
|
|
||||||
lightdm.greeters.mini.user = config.my.username;
|
|
||||||
defaultSession = "none+bspwm";
|
defaultSession = "none+bspwm";
|
||||||
};
|
};
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -45,6 +36,9 @@ with lib;
|
|||||||
# Enable GTK configuration.
|
# Enable GTK configuration.
|
||||||
gtk.enable = true;
|
gtk.enable = true;
|
||||||
|
|
||||||
|
# Set the wallpaper.
|
||||||
|
home.file.".background-image".source = ./config/wallpaper;
|
||||||
|
|
||||||
# Enable QT configuration and set it to the same GTK config.
|
# Enable QT configuration and set it to the same GTK config.
|
||||||
qt.enable = true;
|
qt.enable = true;
|
||||||
qt.platformTheme = "gtk";
|
qt.platformTheme = "gtk";
|
||||||
@ -89,14 +83,14 @@ with lib;
|
|||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
# Set the cursor theme.
|
# Set the cursor theme.
|
||||||
xdg.dataFile = {
|
xdg.dataFile = {
|
||||||
"icons/default/index.theme".text = ''
|
"icons/default/index.theme".text = ''
|
||||||
[icon theme]
|
[icon theme]
|
||||||
Inherits=Adwaita
|
Inherits=Adwaita
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
my.packages = with pkgs; [
|
my.packages = with pkgs; [
|
||||||
|
Loading…
Reference in New Issue
Block a user