Big refactor WIP

This commit is contained in:
2022-04-15 16:40:32 +01:00
parent b1b692dbdf
commit ec73d821aa
35 changed files with 107 additions and 206 deletions

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# My NixOS config
Uses flakes and home-manager

12
flake.lock generated
View File

@@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1649887921,
"narHash": "sha256-h2LZzn5LLwIFvVFLCdR8+VWluEP3U1I5y+0mDZjFjAk=",
"lastModified": 1649984295,
"narHash": "sha256-55dgKGs7W8eC3s9GYewll9y4IlP/KAlSinjQwshNpxM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "92f58b6728e7c631a7ea0ed68cd21bb29a4876ff",
"rev": "d49d68f4196d32c5039cb9e91d730cee894f6f14",
"type": "github"
},
"original": {
@@ -57,11 +57,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1649784051,
"narHash": "sha256-XN6gEvLzUglWIClT1CyyriZfcAhdFj28krCtWLJ/UBI=",
"lastModified": 1649986882,
"narHash": "sha256-cNsInUFq1MbuvaEmv8x6jetWnmAU+osMpnwKumtjksI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e1118817a12dba39081d9e70ae52dd38aa184c2e",
"rev": "5181d5945eda382ff6a9ca3e072ed6ea9b547fee",
"type": "github"
},
"original": {

View File

@@ -16,64 +16,37 @@
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
lib = nixpkgs.lib;
hostSystem = { hostname }: lib.nixosSystem {
hostSystem = { hostname, headless }: lib.nixosSystem {
inherit system;
modules = [
./hosts/${hostname}/configuration.nix
({ pkgs, ... }: {
nixpkgs.overlays = [ i3utils.overlay ];
})
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
users = import ./users;
extraSpecialArgs = {inherit hostname; inherit headless;};
};
}
];
};
mkUserConf = { hostname, extraSauce ? [] }:
home-manager.lib.homeManagerConfiguration {
inherit system pkgs;
username = "daniel";
homeDirectory = "/home/daniel";
configuration = {
imports = [
./user/daniel/home.nix
({ pkgs, ... }: {
nixpkgs.overlays = [ i3utils.overlay ];
})
] ++ extraSauce;
};
stateVersion = "21.05";
};
in {
homeConfigurations = {
daniel-dingbox = mkUserConf {
hostname = "dingbox";
extraSauce = [ ./user/host-specific/dingbox ];
};
daniel-miniding = mkUserConf {
hostname = "miniding";
extraSauce = [ ./user/host-specific/miniding ];
};
daniel-pingbox = mkUserConf {
hostname = "pingbox";
extraSauce = [ ./user/host-specific/pingbox ];
};
};
nixosConfigurations = {
dingbox = hostSystem { hostname = "dingbox"; };
miniding = hostSystem { hostname = "miniding"; };
pingbox = hostSystem { hostname = "pingbox"; };
dingserver = hostSystem { hostname = "dingserver"; };
dingbox = hostSystem { hostname = "dingbox"; headless = false; };
miniding = hostSystem { hostname = "miniding"; headless = false; };
pingbox = hostSystem { hostname = "pingbox"; headless = false; };
dingserver = hostSystem { hostname = "dingserver"; headless = true; };
};
};
}

View File

@@ -1,6 +1,6 @@
{ config, pkgs, lib, ...}:
{ config, pkgs, lib, ...}:
{
# Use the systemd-boot EFI boot loader.
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.enable = lib.mkDefault true;

View File

@@ -1,13 +0,0 @@
#!/bin/sh
if [ "$UID" -ne 0 ]; then
sudo true # Prompt user for password so it doesn't happen in the middle of the script
fi
pushd ~/.dotfiles
nix flake update
hn=$(hostname)
home-manager switch --flake .#daniel-$hn
sudo nixos-rebuild switch --flake .#
popd

View File

@@ -1,11 +0,0 @@
#!/bin/sh
if [ "$UID" -ne 0 ]; then
sudo true # Prompt user for password so it doesn't happen in the middle of the script
fi
pushd ~/.dotfiles
hn=$(hostname)
home-manager switch --flake .#daniel-$hn
sudo nixos-rebuild switch --flake .#
popd

View File

@@ -1,6 +0,0 @@
#!/bin/sh
pushd ~/.dotfiles
hn=$(hostname)
home-manager switch --flake .#daniel-$hn
popd

View File

@@ -0,0 +1,8 @@
{
imports = [
./i3
./i3status-rust
# ./polybar
./rofi
];
}

View File

@@ -18,7 +18,7 @@
background-color: @drac-bgd;
active-background: @drac-pnk;
urgent-background: @drac-red;
selected-background: @active-background;
selected-urgent-background: @urgent-background;
selected-active-background: @active-background;

View File

@@ -0,0 +1,8 @@
{
imports = [
./alacritty
./helix
./kitty
./neovim
];
}

View File

@@ -0,0 +1,7 @@
{...}:
{
home.file.".config/helix" = {
source = ./config;
recursive = true;
};
}

View File

@@ -1,21 +1,62 @@
{ pkgs, fetchurl, ... }:
{ pkgs, lib, fetchurl, hostname, headless, ... }:
let
cliPackages = with pkgs; [
aerc
entr
go_1_18
gomuks
gopls
oh-my-zsh
(
let
my-python-packages = python-packages: with python-packages; [
tkinter
requests
];
python-with-my-packages = python3.withPackages my-python-packages;
in
python-with-my-packages
)
ranger
restic
rust-analyzer
starship
];
guiPackages = with pkgs; [
_1password
_1password-gui
discord
feh
iosevka
jetbrains.goland
mpv
nerdfonts
pamixer
pavucontrol
playerctl
spotify
xclip
];
in
{
imports = [
../progs/alacritty
../progs/i3
../progs/i3status-rust
../progs/kitty
../progs/neovim
../progs/rofi
./configs/system
] ++ lib.optionals (!headless) [
./configs/desktop
] ++ lib.optionals (builtins.pathExists ./host-specific/${hostname}) [
./host-specific/${hostname}
];
home = {
username = "daniel";
homeDirectory = "/home/daniel";
sessionVariables = {
EDITOR = "hx";
};
sessionPath = [
"$HOME/go/bin"
];
@@ -23,23 +64,8 @@
file = {
".icons/default".source = "${pkgs.capitaine-cursors}/share/icons/capitaine-cursors";
".config/helix" = {
source = ../progs/helix;
recursive = true;
};
"bin/aupdate" = {
source = ../../scripts/aupdate;
executable = true;
};
"bin/bupdate" = {
source = ../../scripts/bupdate;
executable = true;
};
"bin/hmupdate" = {
source = ../../scripts/hmupdate;
"bin/update" = {
source = ../../scripts/update;
executable = true;
};
@@ -47,48 +73,9 @@
source = ../../scripts/supdate;
executable = true;
};
"bin/update" = {
source = ../../scripts/update;
executable = true;
};
};
packages = with pkgs; [
_1password
_1password-gui
aerc
discord
entr
feh
go_1_18
gomuks
gopls
helix
iosevka
mpv
nerdfonts
oh-my-zsh
pamixer
pavucontrol
playerctl
(
let
my-python-packages = python-packages: with python-packages; [
tkinter
requests
];
python-with-my-packages = python3.withPackages my-python-packages;
in
python-with-my-packages
)
ranger
restic
rust-analyzer
spotify
starship
xclip
];
packages = cliPackages ++ lib.optionals (!headless) guiPackages;
keyboard = {
layout = "gb";

View File

@@ -7,10 +7,6 @@
};
};
home.packages = with pkgs; [
jetbrains.goland
];
programs.alacritty.settings.font.size = 13;
programs.kitty.font.size = 22;
}

View File

Before

Width:  |  Height:  |  Size: 835 KiB

After

Width:  |  Height:  |  Size: 835 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

Before

Width:  |  Height:  |  Size: 411 KiB

After

Width:  |  Height:  |  Size: 411 KiB

View File

Before

Width:  |  Height:  |  Size: 665 KiB

After

Width:  |  Height:  |  Size: 665 KiB

View File

@@ -7,10 +7,6 @@
source = ./wallpapers;
};
};
packages = with pkgs; [
jetbrains.goland
];
};
programs.kitty.font.size = 19;

View File

Before

Width:  |  Height:  |  Size: 523 KiB

After

Width:  |  Height:  |  Size: 523 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -1,50 +0,0 @@
{ config, pkgs, ... }:
{
programs.i3status-rust = {
enable = true;
bars = {
main = {
theme = "dracula";
icons = "awesome";
blocks = [
{
block = "time";
}
{
block = "battery";
allow_missing = true;
hide_missing = true;
}
{
block = "backlight";
device = "intel_backlight";
step_width = 10;
invert_icons = true;
}
{
block = "networkmanager";
on_click = "alacritty -e nmtui";
primary_only = true;
ap_format = "{ssid}";
device_format = "{icon}{ap}";
}
{
block = "keyboard_layout";
}
{
block = "notify";
}
{
block = "music";
player = "spotify";
buttons = [ "prev" "play" "next" ];
}
{
block = "sound";
}
];
};
};
};
}

3
users/default.nix Normal file
View File

@@ -0,0 +1,3 @@
{
daniel = import ./daniel;
}