Compare commits

...

2 Commits

Author SHA1 Message Date
Riley Apeldoorn ae41b3ae55 Remove old config 2022-05-23 10:22:08 +02:00
Riley Apeldoorn 5247a535b1 Reformat 2022-05-23 10:16:05 +02:00
3 changed files with 165 additions and 251 deletions

View File

@ -1,87 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
{
config = {
imports = [
# Home-manager modules
<home-manager/nixos>
./hardware-configuration.nix
# Programs
./modules/kakoune
./alacritty.nix
./git.nix
# Display server and related config
./display.nix
./fonts.nix
];
nixpkgs.config.allowUnfree = true;
nix.autoOptimiseStore = true;
nix.gc.automatic = true;
boot = {
loader.systemd-boot = {
enable = true;
editor = false;
configurationLimit = 10;
};
loader.efi.canTouchEfiVariables = true;
cleanTmpDir = true;
};
networking.hostName = "thor";
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
networking.useDHCP = false;
networking.interfaces.enp9s0.useDHCP = true;
sound.enable = true;
hardware.pulseaudio.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users."riley" = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
};
environment.systemPackages = with pkgs; [
# Some utils
wget
curl
git
# Modern coreutils
ripgrep
bottom
skim
exa
bat
lf
fd
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
};
}

22
env.nix
View File

@ -1,15 +1,15 @@
# Packages I tend to use # Packages I tend to use
{ pkgs }: pkgs.buildEnv { { pkgs }: pkgs.buildEnv {
name = "riley-user-utils"; name = "riley-user-utils";
paths = with pkgs; [ paths = with pkgs; [
ripgrep ripgrep
bottom bottom
delta delta
skim skim
exa exa
bat bat
lf lf
fd fd
]; ];
} }

View File

@ -3,120 +3,121 @@
{ config, lib, pkgs, home-manager, ... }: { config, lib, pkgs, home-manager, ... }:
with lib; with types; with lib; with types;
let named = submodule { let themeType =
options = { let named = submodule {
normal = mkOption { type = str; }; options = {
bright = mkOption { type = str; }; normal = mkOption { type = str; };
pastel = mkOption { type = str; }; bright = mkOption { type = str; };
}; pastel = mkOption { type = str; };
}; };
special = submodule { };
options = { special = submodule {
primary = mkOption { type = str; }; options = {
normal = mkOption { type = str; }; primary = mkOption { type = str; };
slight = mkOption { type = str; }; normal = mkOption { type = str; };
}; slight = mkOption { type = str; };
}; };
themeType = submodule { };
options = { in submodule {
foreground = mkOption { type = special; }; options = {
background = mkOption { type = special; }; foreground = mkOption { type = special; };
grayscales = mkOption { type = listOf str; }; background = mkOption { type = special; };
red = mkOption { type = named; }; grayscales = mkOption { type = listOf str; };
green = mkOption { type = named; }; red = mkOption { type = named; };
blue = mkOption { type = named; }; green = mkOption { type = named; };
yellow = mkOption { type = named; }; blue = mkOption { type = named; };
purple = mkOption { type = named; }; yellow = mkOption { type = named; };
cyan = mkOption { type = named; }; purple = mkOption { type = named; };
pink = mkOption { type = named; }; cyan = mkOption { type = named; };
orange = mkOption { type = named; }; pink = mkOption { type = named; };
misc = mkOption { type = attrsOf str; }; orange = mkOption { type = named; };
hex = mkOption { type = themeType; }; misc = mkOption { type = attrsOf str; };
}; hex = mkOption { type = themeType; };
}; };
};
utils = import ../env.nix { inherit pkgs; }; utils = import ../env.nix { inherit pkgs; };
in { in {
options.riley = with lib; { options.riley = with lib; {
theme = mkOption { theme = mkOption {
type = themeType; type = themeType;
description = '' description = ''
The theme used across the installation. Not used if gui is disabled. The theme used across the installation. Not used if gui is disabled.
''; '';
}; };
}; };
options.devices = mkOption { options.devices = mkOption {
type = with types; submodule { type = with types; submodule {
options = { options = {
audio = mkOption {
type = nullOr (submodule {
options = {
speakers = mkOption { type = str; };
external = mkOption { type = str; };
headset = mkOption { type = nullOr str; };
main-mic = mkOption { type = nullOr str; };
};
});
description = ''
Known audio devices: outputs & microphones.
Each string should be a pulseaudio sink or source.
'';
};
video = mkOption { audio = mkOption {
type = submodule { type = nullOr (submodule {
options = { options = {
displays = let output = submodule { speakers = mkOption { type = str; };
options = { external = mkOption { type = str; };
primary = mkOption { headset = mkOption { type = nullOr str; };
type = bool; main-mic = mkOption { type = nullOr str; };
default = false; };
}; });
position = mkOption { description = ''
type = nullOr (listOf int); Known audio devices: outputs & microphones.
default = null; Each string should be a pulseaudio sink or source.
}; '';
rotate = mkOption { };
type = enum [ "normal" "left" "right" "inverted" ];
default = "normal"; video = mkOption {
}; type = submodule {
}; options = {
}; in mkOption { displays = let output = submodule {
type = attrsOf output; options = {
description = '' primary = mkOption {
A list of outputs with information on how to place them. type = bool;
''; default = false;
}; };
}; position = mkOption {
}; type = nullOr (listOf int);
description = '' default = null;
Define the video devices (just the displays, for now). };
''; rotate = mkOption {
}; type = enum [ "normal" "left" "right" "inverted" ];
default = "normal";
}; };
}; };
}; }; in mkOption {
type = attrsOf output;
description = ''
A list of outputs with information on how to place them.
'';
};
};
};
description = ''
Define the video devices (just the displays, for now).
'';
};
};
};
};
imports = [ imports = [
home-manager.nixosModule home-manager.nixosModule
./kak ./kak
./gui ./gui
./fonts.nix ./fonts.nix
./git.nix ./git.nix
./ssh.nix ./ssh.nix
]; ];
config = { config = {
@ -126,79 +127,79 @@ in {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
environment.systemPackages = with pkgs; [
# Web utils environment.systemPackages = with pkgs; [
wget # Web utils
curl
git wget
curl
git
# Common utils (rg, sk, fd, etc.) # Common utils (rg, sk, fd, etc.)
utils utils
];
environment.shellAliases = { ];
# Born to VIM environment.shellAliases = {
":q" = "exit";
# Born to VIM
":q" = "exit";
# Sike I use kakoune # Sike I use kakoune
":e" = "kak"; ":e" = "kak";
# Launch [T]erminal # Launch [T]erminal
"t" = "alacritty"; "t" = "alacritty";
# [D]isown # [D]isown
"d" = "disown"; "d" = "disown";
}; };
programs.bash.interactiveShellInit = '' programs.bash.interactiveShellInit = ''
# [G]o to the directory. Create the directory if it does not exist # [G]o to the directory. Create the directory if it does not exist
# yet, and if the directory contains a shell.nix file, source it. # yet, and if the directory contains a shell.nix file, source it.
g () { g () {
[ -d "$1" ] || mkdir -p "$1"; [ -d "$1" ] || mkdir -p "$1";
cd "$1"; cd "$1";
[ -e "shell.nix" ] && nix-shell; [ -e "shell.nix" ] && nix-shell;
} }
# [M]ake a directory and immediately enter it. # [M]ake a directory and immediately enter it.
m () { mkdir -p "$1" && cd "$1"; } m () { mkdir -p "$1" && cd "$1"; }
# [R]eplace the current process with the given one. # [R]eplace the current process with the given one.
r () { $1 & disown; exit; } r () { $1 & disown; exit; }
# [J]ump to the directory by means of fuzzy search. If the fuzzy finder # [J]ump to the directory by means of fuzzy search. If the fuzzy finder
# is aborted, the jump is also aborted. # is aborted, the jump is also aborted.
j () { t=`sk` && cd $t; } j () { t=`sk` && cd $t; }
# Enter a temporary [d]irectory. # Enter a temporary [d]irectory.
d () { cd "$(mktemp -d)"; } d () { cd "$(mktemp -d)"; }
'';
boot = { '';
loader.systemd-boot = {
enable = true;
editor = false;
configurationLimit = 10;
};
loader.efi = { boot = {
canTouchEfiVariables = true; loader.systemd-boot = {
}; enable = true;
}; editor = false;
configurationLimit = 10;
};
networking = { loader.efi = {
firewall.enable = false; canTouchEfiVariables = true;
useDHCP = false; };
}; };
security.rtkit.enable = true; networking = {
firewall.enable = false;
useDHCP = false;
};
security.rtkit.enable = true;
users.users."riley" = { users.users."riley" = {
isNormalUser = true; isNormalUser = true;