Add various tweaks & fixes
- Add standalone home-manager conf usable outside nixos - Fix HID devices being suspended by powertop - Fix emacs font config & add deps for vterm module compilation - Fix Network setup with per-device gateway - Replace onetab with foss alternative (Tab Stash) - Improve README.md
This commit is contained in:
parent
ab7249df82
commit
e66122aa4c
6 changed files with 401 additions and 346 deletions
12
README.md
12
README.md
|
@ -1,5 +1,11 @@
|
||||||
# My nix conf
|
# My nix conf
|
||||||
|
|
||||||
|
## 🏠 Home Setup
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix run home-manager/release-23.05 -- switch --flake .
|
||||||
|
```
|
||||||
|
|
||||||
## 🏗️ System Setup
|
## 🏗️ System Setup
|
||||||
|
|
||||||
### 👷 "Manual"
|
### 👷 "Manual"
|
||||||
|
@ -32,6 +38,12 @@ nix flake update
|
||||||
sudo nixos-rebuild --flake .#nixos-pulse switch
|
sudo nixos-rebuild --flake .#nixos-pulse switch
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Run this to keep your home up-to-date.
|
||||||
|
```bash
|
||||||
|
nix flake update
|
||||||
|
home-manager switch --flake .
|
||||||
|
```
|
||||||
|
|
||||||
## 🙏 Made possible by
|
## 🙏 Made possible by
|
||||||
|
|
||||||
- NixOS: https://nixos.org/
|
- NixOS: https://nixos.org/
|
||||||
|
|
|
@ -15,10 +15,12 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
fonts.fonts = with pkgs; [
|
fonts.fonts = with pkgs; [
|
||||||
|
emacs-all-the-icons-fonts
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-cjk
|
noto-fonts-cjk
|
||||||
noto-fonts-emoji
|
noto-fonts-emoji
|
||||||
liberation_ttf
|
liberation_ttf
|
||||||
|
fira
|
||||||
fira-code
|
fira-code
|
||||||
fira-code-symbols
|
fira-code-symbols
|
||||||
mplus-outline-fonts.githubRelease
|
mplus-outline-fonts.githubRelease
|
||||||
|
@ -145,6 +147,13 @@
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
|
|
||||||
powerManagement.powertop.enable = true;
|
powerManagement.powertop.enable = true;
|
||||||
|
systemd.services.powertop.postStart = ''
|
||||||
|
HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u)
|
||||||
|
for i in $HIDDEVICES; do
|
||||||
|
echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product
|
||||||
|
echo 'on' > /sys/bus/usb/devices/$i/power/control
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
|
|
38
flake.nix
38
flake.nix
|
@ -34,33 +34,53 @@
|
||||||
emacs-overlay,
|
emacs-overlay,
|
||||||
disko,
|
disko,
|
||||||
nur,
|
nur,
|
||||||
}: {
|
}: let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
customPkgs = import nixpkgs {
|
||||||
|
system = "${system}";
|
||||||
|
overlays = [emacs-overlay.overlay];
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
formatter = {
|
formatter = {
|
||||||
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra;
|
||||||
};
|
};
|
||||||
diskoConfigurations = {
|
diskoConfigurations = {
|
||||||
nixos-pulse = import ./disko.nix;
|
nixos-pulse = import ./disko.nix;
|
||||||
};
|
};
|
||||||
nixosConfigurations = let
|
homeConfigurations = {
|
||||||
customPkgs = import nixpkgs {
|
"tristand" = home-manager.lib.homeManagerConfiguration {
|
||||||
system = "x86_64-linux";
|
inherit pkgs;
|
||||||
overlays = [emacs-overlay.overlay];
|
|
||||||
config = {
|
modules = [
|
||||||
allowUnfree = true;
|
./home.nix
|
||||||
|
nur.hmModules.nur
|
||||||
|
{
|
||||||
|
_module.args.customPkgs = customPkgs;
|
||||||
|
# inherit customPkgs;
|
||||||
|
# pkgs.pkgs = customPkgs;
|
||||||
|
# home-manager.useUserPackages = true;
|
||||||
|
# home-manager.useGlobalPkgs = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
nixosConfigurations = {
|
||||||
nixos-pulse = nixpkgs.lib.nixosSystem {
|
nixos-pulse = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
./home.nix
|
./users.nix
|
||||||
./disko.nix
|
./disko.nix
|
||||||
disko.nixosModules.disko
|
disko.nixosModules.disko
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
tuxedo-nixos.nixosModules.default
|
tuxedo-nixos.nixosModules.default
|
||||||
nur.nixosModules.nur
|
nur.nixosModules.nur
|
||||||
{
|
{
|
||||||
|
_module.args.customPkgs = customPkgs;
|
||||||
nixpkgs.pkgs = customPkgs;
|
nixpkgs.pkgs = customPkgs;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
20
hardware.nix
20
hardware.nix
|
@ -37,19 +37,21 @@
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
ipv4.routes = [
|
||||||
|
{
|
||||||
|
address = "192.168.0.0";
|
||||||
|
prefixLength = 24;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
address = "0.0.0.0";
|
||||||
|
prefixLength = 0;
|
||||||
|
via = "192.168.0.5";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO delete if network specific gateway is validated to work
|
|
||||||
# defaultGateway = {
|
|
||||||
# address = "192.168.0.5";
|
|
||||||
# interface = "enp5s0f4u1u1c2";
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO validate his works
|
|
||||||
systemd.network.networks.enp5s0f4u1u1c2.gateway = "192.168.0.5";
|
|
||||||
|
|
||||||
# This manually configures the automatically created network-adresses service to be more flexible
|
# This manually configures the automatically created network-adresses service to be more flexible
|
||||||
# regarding booting without the the device being available on boot
|
# regarding booting without the the device being available on boot
|
||||||
# It prevents slow timeouts & errors on boot while preserving Plug & Play ability
|
# It prevents slow timeouts & errors on boot while preserving Plug & Play ability
|
||||||
|
|
33
home.nix
33
home.nix
|
@ -1,24 +1,9 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
|
customPkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
fonts.fonts = [pkgs.emacs-all-the-icons-fonts];
|
|
||||||
|
|
||||||
users.users.tristand = {
|
|
||||||
isNormalUser = true;
|
|
||||||
description = "Tristan Druyen";
|
|
||||||
extraGroups = ["networkmanager" "wheel" "libvirtd"];
|
|
||||||
shell = pkgs.fish;
|
|
||||||
home = "/home/tristand";
|
|
||||||
hashedPassword = "$6$Wj.XY8JgH5EWuog4$HnbtPJXDEqKXFrzkPVEjih3PytcpBCrkfL7TAwkXd0IFced7kGMlZNliNsAqQ3XqfyUzAYiiKTIqoPVJEk.s..";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.tristand = {pkgs, ...}: {
|
|
||||||
nix = {
|
|
||||||
settings.experimental-features = ["nix-command" "flakes"];
|
|
||||||
};
|
|
||||||
|
|
||||||
dconf.settings = {
|
dconf.settings = {
|
||||||
"org/virt-manager/virt-manager/connections" = {
|
"org/virt-manager/virt-manager/connections" = {
|
||||||
autoconnect = ["qemu:///system"];
|
autoconnect = ["qemu:///system"];
|
||||||
|
@ -40,7 +25,7 @@
|
||||||
services.emacs = {
|
services.emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
package = pkgs.emacs-unstable-pgtk;
|
package = customPkgs.emacs-unstable-pgtk;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
|
@ -50,6 +35,7 @@
|
||||||
ec = "emacsclient $argv";
|
ec = "emacsclient $argv";
|
||||||
ecc = "emacsclient -c $argv";
|
ecc = "emacsclient -c $argv";
|
||||||
ecr = "emacsclient -r $argv";
|
ecr = "emacsclient -r $argv";
|
||||||
|
ecrr = "emacsclient -r $argv";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -96,18 +82,17 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
extensions = with config.nur.repos.rycee.firefox-addons; [
|
extensions = with config.nur.repos.rycee.firefox-addons; [
|
||||||
betterttv
|
|
||||||
bitwarden
|
bitwarden
|
||||||
clearurls
|
clearurls
|
||||||
consent-o-matic
|
consent-o-matic
|
||||||
darkreader
|
darkreader
|
||||||
localcdn
|
localcdn
|
||||||
onetab
|
|
||||||
plasma-integration
|
plasma-integration
|
||||||
privacy-badger
|
privacy-badger
|
||||||
rust-search-extension
|
rust-search-extension
|
||||||
skip-redirect
|
skip-redirect
|
||||||
sponsorblock
|
sponsorblock
|
||||||
|
tab-stash
|
||||||
ublock-origin
|
ublock-origin
|
||||||
unpaywall
|
unpaywall
|
||||||
];
|
];
|
||||||
|
@ -305,6 +290,9 @@
|
||||||
enableSshSupport = true;
|
enableSshSupport = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.username = "tristand";
|
||||||
|
home.homeDirectory = "/home/tristand";
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
alejandra
|
alejandra
|
||||||
atool
|
atool
|
||||||
|
@ -319,7 +307,8 @@
|
||||||
brave
|
brave
|
||||||
btop
|
btop
|
||||||
direnv
|
direnv
|
||||||
emacs-unstable-pgtk
|
cmake
|
||||||
|
customPkgs.emacs-unstable-pgtk
|
||||||
firefox
|
firefox
|
||||||
jellyfin-media-player
|
jellyfin-media-player
|
||||||
neofetch
|
neofetch
|
||||||
|
@ -330,6 +319,9 @@
|
||||||
rust-motd
|
rust-motd
|
||||||
(ripgrep.override {withPCRE2 = true;})
|
(ripgrep.override {withPCRE2 = true;})
|
||||||
gnutls
|
gnutls
|
||||||
|
gnumake
|
||||||
|
gcc
|
||||||
|
libtool
|
||||||
fd
|
fd
|
||||||
imagemagick
|
imagemagick
|
||||||
pinentry-emacs
|
pinentry-emacs
|
||||||
|
@ -351,5 +343,4 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home.stateVersion = "23.05";
|
home.stateVersion = "23.05";
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
21
users.nix
Normal file
21
users.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
customPkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
users.users.tristand = {
|
||||||
|
isNormalUser = true;
|
||||||
|
description = "Tristan Druyen";
|
||||||
|
extraGroups = ["networkmanager" "wheel" "libvirtd"];
|
||||||
|
shell = pkgs.fish;
|
||||||
|
home = "/home/tristand";
|
||||||
|
hashedPassword = "$6$Wj.XY8JgH5EWuog4$HnbtPJXDEqKXFrzkPVEjih3PytcpBCrkfL7TAwkXd0IFced7kGMlZNliNsAqQ3XqfyUzAYiiKTIqoPVJEk.s..";
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.tristand = import ./home.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit config;
|
||||||
|
inherit customPkgs;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue