Added initial files
This commit is contained in:
commit
0c97384a8d
20 changed files with 874 additions and 0 deletions
143
flake.lock
generated
Normal file
143
flake.lock
generated
Normal file
|
|
@ -0,0 +1,143 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"utils": "utils"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1669740584,
|
||||||
|
"narHash": "sha256-rHxz/olYeCx9GHjJTZElkVCVo4aXaP9FNaQ8oyCLz9A=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "3b0a446bbf29cfeb78e0d1a8210bdf6fae8efccd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager-stable": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs-stable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667907331,
|
||||||
|
"narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "6639e3a837fc5deb6f99554072789724997bc8e5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"ref": "release-22.05",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"kmonad": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"dir": "nix",
|
||||||
|
"lastModified": 1669553353,
|
||||||
|
"narHash": "sha256-q2sn1vqpzTAEmWLBnslEjKwTpTR1bT7YnuLbuLFfVUw=",
|
||||||
|
"owner": "kmonad",
|
||||||
|
"repo": "kmonad",
|
||||||
|
"rev": "596ed91500d6908b3dc8b97023f431115900c470",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "nix",
|
||||||
|
"owner": "kmonad",
|
||||||
|
"repo": "kmonad",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1669542132,
|
||||||
|
"narHash": "sha256-DRlg++NJAwPh8io3ExBJdNW7Djs3plVI5jgYQ+iXAZQ=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "a115bb9bd56831941be3776c8a94005867f316a7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-stable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1669546925,
|
||||||
|
"narHash": "sha256-Gvtk9agz88tBgqmCdHl5U7gYttTkiuEd8/Rq1Im0pTg=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "fecf05d4861f3985e8dee73f08bc82668ef75125",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-22.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nur": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1669749637,
|
||||||
|
"narHash": "sha256-QAJt9dov1gJTNFaWbEwaHV1IDtVrsM18E7LsLsvsHIA=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nur",
|
||||||
|
"rev": "f7b4e636b872255bf3ea0712d93ce9dc934d4076",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nur",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"home-manager-stable": "home-manager-stable",
|
||||||
|
"kmonad": "kmonad",
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
|
"nur": "nur"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1667395993,
|
||||||
|
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
55
flake.nix
Normal file
55
flake.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
||||||
|
{
|
||||||
|
description = "My nix hosts";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
nur.url = "github:nix-community/nur";
|
||||||
|
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager/master";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
kmonad = {
|
||||||
|
url = "github:kmonad/kmonad?dir=nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-22.05";
|
||||||
|
|
||||||
|
home-manager-stable = {
|
||||||
|
url = "github:nix-community/home-manager/release-22.05";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-stable";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { nixpkgs, home-manager, nur, kmonad, nixpkgs-stable, home-manager-stable, ... }: {
|
||||||
|
nixosConfigurations = {
|
||||||
|
io = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./hosts/desktops/io.nix
|
||||||
|
kmonad.nixosModules.default
|
||||||
|
{ nixpkgs.overlays = [ nur.overlay ]; }
|
||||||
|
# ( {...}: { nix.registry.nixpkgs.flake = nixpkgs; } )
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.user = import ./users/desktops/io/user.nix;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
alexandria = nixpkgs-stable.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./hosts/servers/alexandria/configuration.nix
|
||||||
|
( {...}: { nix.registry.nixpkgs.flake = nixpkgs-stable; } )
|
||||||
|
home-manager-stable.nixosModules.home-manager
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
15
hosts/common/boot.nix
Normal file
15
hosts/common/boot.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
timeout = 1;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
systemd-boot = {
|
||||||
|
enable = true;
|
||||||
|
editor = false;
|
||||||
|
netbootxyz.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
20
hosts/common/locale.nix
Normal file
20
hosts/common/locale.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
time.timeZone = "America/Bahia";
|
||||||
|
|
||||||
|
i18n = {
|
||||||
|
defaultLocale = "en_US.UTF-8";
|
||||||
|
extraLocaleSettings = {
|
||||||
|
LC_ADDRESS = "pt_BR.utf8";
|
||||||
|
LC_IDENTIFICATION = "pt_BR.utf8";
|
||||||
|
LC_MEASUREMENT = "pt_BR.utf8";
|
||||||
|
LC_MONETARY = "pt_BR.utf8";
|
||||||
|
LC_NAME = "pt_BR.utf8";
|
||||||
|
LC_NUMERIC = "pt_BR.utf8";
|
||||||
|
LC_PAPER = "pt_BR.utf8";
|
||||||
|
LC_TELEPHONE = "pt_BR.utf8";
|
||||||
|
LC_TIME = "en_IE.utf8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
11
hosts/common/networking.nix
Normal file
11
hosts/common/networking.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
networking = {
|
||||||
|
networkmanager.enable = true;
|
||||||
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
checkReversePath = "loose"; # Tailscale mail fail without this
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
13
hosts/common/nix.nix
Normal file
13
hosts/common/nix.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
|
gc = { # Garbage collector
|
||||||
|
automatic = true;
|
||||||
|
options = "--delete-older-than 8d";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
system.stateVersion = "22.05";
|
||||||
|
}
|
||||||
23
hosts/common/packages.nix
Normal file
23
hosts/common/packages.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nixpkgs.config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
any-nix-shell
|
||||||
|
bind
|
||||||
|
btop
|
||||||
|
git
|
||||||
|
lazydocker
|
||||||
|
micro
|
||||||
|
tmux
|
||||||
|
tree
|
||||||
|
wget
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
fish.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
hosts/common/services.nix
Normal file
10
hosts/common/services.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
fwupd.enable = true;
|
||||||
|
fstrim.enable = true;
|
||||||
|
openssh.enable = true;
|
||||||
|
tailscale.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
21
hosts/common/users.nix
Normal file
21
hosts/common/users.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
users.users = {
|
||||||
|
user = {
|
||||||
|
isNormalUser = true;
|
||||||
|
shell = pkgs.fish;
|
||||||
|
extraGroups = [
|
||||||
|
"networkmanager"
|
||||||
|
"wheel"
|
||||||
|
];
|
||||||
|
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKcwF1yuWEfYGScNocEbs0AmGxyTIzGc4/IhpU587SJE" ];
|
||||||
|
hashedPassword = "$6$Pj7v/CpstyuWQQV0$cNujVDhfMBdwlGVEnnd8t71.kZPixbo0u25cd.874iaqLTH4V5fa1f98V5zGapjQCz5JyZmsR94xi00sUrntT0";
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
shell = pkgs.fish;
|
||||||
|
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKcwF1yuWEfYGScNocEbs0AmGxyTIzGc4/IhpU587SJE" ];
|
||||||
|
hashedPassword = "!";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
22
hosts/desktops/common/boot.nix
Normal file
22
hosts/desktops/common/boot.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
boot = {
|
||||||
|
plymouth.enable = true;
|
||||||
|
initrd.systemd.enable = true;
|
||||||
|
loader.efi.efiSysMountPoint = "/boot/efi";
|
||||||
|
kernelPackages = pkgs.linuxPackages_xanmod_latest; # Xanmod kernel
|
||||||
|
kernelModules = [
|
||||||
|
"i2c-dev" # Required for arduino dev
|
||||||
|
"i2c-piix4" # Required for arduino dev
|
||||||
|
];
|
||||||
|
kernelParams = [
|
||||||
|
"quiet"
|
||||||
|
"splash"
|
||||||
|
"loglevel=3"
|
||||||
|
"udev.log_priority=3"
|
||||||
|
"rd.udev.log_level=3"
|
||||||
|
"rd.systemd.show_status=false"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
14
hosts/desktops/common/hardware.nix
Normal file
14
hosts/desktops/common/hardware.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
hardware = {
|
||||||
|
bluetooth.enable = true;
|
||||||
|
opengl.driSupport32Bit = true; # For OpenGL games
|
||||||
|
steam-hardware.enable = true; # Allow steam client to manage controllers
|
||||||
|
pulseaudio.enable = false; # Use pipewire instead
|
||||||
|
};
|
||||||
|
|
||||||
|
sound.enable = true;
|
||||||
|
|
||||||
|
security.rtkit.enable = true; # Needed for pipewire to acquire realtime priority
|
||||||
|
}
|
||||||
82
hosts/desktops/common/packages.nix
Normal file
82
hosts/desktops/common/packages.nix
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
arduino
|
||||||
|
ark
|
||||||
|
bat
|
||||||
|
bitwarden
|
||||||
|
chatterino2
|
||||||
|
deploy-rs
|
||||||
|
fd
|
||||||
|
filelight
|
||||||
|
firefox-wayland # Until firefox moves to using wayland by default
|
||||||
|
foliate
|
||||||
|
fzf
|
||||||
|
gimp
|
||||||
|
gocryptfs
|
||||||
|
helvum
|
||||||
|
heroic
|
||||||
|
inkscape
|
||||||
|
# itch # Currently using unsafe electron version
|
||||||
|
kate
|
||||||
|
kitty
|
||||||
|
kolourpaint
|
||||||
|
libreoffice-qt
|
||||||
|
logseq
|
||||||
|
mangohud
|
||||||
|
megasync # Soon to be dropped once nas is fully operational
|
||||||
|
mpv
|
||||||
|
neofetch
|
||||||
|
obs-studio
|
||||||
|
obs-studio-plugins.obs-vkcapture
|
||||||
|
prismlauncher-qt5
|
||||||
|
protonup
|
||||||
|
prusa-slicer
|
||||||
|
qbittorrent
|
||||||
|
quickemu
|
||||||
|
retroarchFull
|
||||||
|
rpcs3
|
||||||
|
signal-desktop
|
||||||
|
solvespace
|
||||||
|
steam-run
|
||||||
|
streamlink-twitch-gui-bin
|
||||||
|
tdesktop
|
||||||
|
thunderbird-wayland # Until thunderbird moves to using wayland by default
|
||||||
|
ungoogled-chromium
|
||||||
|
unrar
|
||||||
|
vagrant
|
||||||
|
ventoy-bin
|
||||||
|
virt-manager
|
||||||
|
yakuake
|
||||||
|
# Package overrides
|
||||||
|
(appimage-run.override {
|
||||||
|
extraPkgs = pkgs: [ ];
|
||||||
|
})
|
||||||
|
# Packages from 3rd party overlays
|
||||||
|
nur.repos.baduhai.koi
|
||||||
|
nur.repos.baduhai.emulationstation-de
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
steam.enable = true;
|
||||||
|
dconf.enable = true;
|
||||||
|
kdeconnect.enable = true;
|
||||||
|
partition-manager.enable = true;
|
||||||
|
gnupg.agent = {
|
||||||
|
enable = true;
|
||||||
|
enableSSHSupport = true;
|
||||||
|
pinentryFlavor = "qt";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts = {
|
||||||
|
fontDir.enable = true;
|
||||||
|
fontconfig.enable = true;
|
||||||
|
fonts = with pkgs; [
|
||||||
|
inter
|
||||||
|
roboto
|
||||||
|
(nerdfonts.override { fonts = [ "Hack" ]; })
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
40
hosts/desktops/common/services.nix
Normal file
40
hosts/desktops/common/services.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
printing.enable = true;
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
jack.enable = true;
|
||||||
|
wireplumber.enable = true;
|
||||||
|
};
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
layout = "us";
|
||||||
|
xkbVariant = "altgr-intl";
|
||||||
|
excludePackages = ( with pkgs; [ xterm ]);
|
||||||
|
desktopManager.plasma5 = {
|
||||||
|
enable = true;
|
||||||
|
excludePackages = ( with pkgs.plasma5Packages; [ elisa oxygen khelpcenter ]);
|
||||||
|
};
|
||||||
|
displayManager = {
|
||||||
|
defaultSession = "plasmawayland";
|
||||||
|
sddm = {
|
||||||
|
enable = true;
|
||||||
|
autoNumlock = true;
|
||||||
|
settings = {
|
||||||
|
Theme = {
|
||||||
|
CursorTheme = "breeze_cursors";
|
||||||
|
};
|
||||||
|
X11 = {
|
||||||
|
UserAuthFile = ".local/share/sddm/Xauthority";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
16
hosts/desktops/common/users.nix
Normal file
16
hosts/desktops/common/users.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
environment.sessionVariables = rec {
|
||||||
|
KDEHOME = "$XDG_CONFIG_HOME/kde4"; # Stops kde from placing a .kde4 folder in the home dir
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.user = {
|
||||||
|
description = "William";
|
||||||
|
extraGroups = [
|
||||||
|
"libvirtd"
|
||||||
|
"uaccess" # Needed for HID dev
|
||||||
|
"dialout" # Needed for arduino dev
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
11
hosts/desktops/common/virtualisation.nix
Normal file
11
hosts/desktops/common/virtualisation.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
virtualisation = {
|
||||||
|
libvirtd.enable = true;
|
||||||
|
podman = {
|
||||||
|
enable = true;
|
||||||
|
dockerCompat = true; # Baisically aliases docker to podman
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
53
hosts/desktops/io.nix
Normal file
53
hosts/desktops/io.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# Host-specific imports
|
||||||
|
./io/hardware-configuration.nix
|
||||||
|
# Host-common imports
|
||||||
|
../../common/networking.nix
|
||||||
|
../../common/services.nix
|
||||||
|
../../common/packages.nix
|
||||||
|
../../common/locale.nix
|
||||||
|
../../common/users.nix
|
||||||
|
../../common/boot.nix
|
||||||
|
../../common/nix.nix
|
||||||
|
# Desktop-common imports
|
||||||
|
../common/virtualisation.nix
|
||||||
|
../common/hardware.nix
|
||||||
|
../common/services.nix
|
||||||
|
../common/packages.nix
|
||||||
|
../common/users.nix
|
||||||
|
../common/boot.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.hostName = "io";
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
gnome-network-displays
|
||||||
|
maliit-keyboard
|
||||||
|
rnote
|
||||||
|
write_stylus
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.kernelParams = [
|
||||||
|
"nosgx"
|
||||||
|
"i915.fastboot=1"
|
||||||
|
"mem_sleep_default=deep"
|
||||||
|
];
|
||||||
|
|
||||||
|
zramSwap = {
|
||||||
|
enable = true;
|
||||||
|
memoryPercent = 100;
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
kmonad = {
|
||||||
|
enable = true;
|
||||||
|
keyboards.internal = {
|
||||||
|
device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd";
|
||||||
|
config = builtins.readFile ./io/kmonad.kbd;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
39
hosts/desktops/io/hardware-configuration.nix
Normal file
39
hosts/desktops/io/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/2321ee32-a952-4a4b-bba0-bb25f616a4a5";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
boot.initrd.luks.devices."luks-008bb7cb-917c-4dda-93fe-542c2285bafb".device = "/dev/disk/by-uuid/008bb7cb-917c-4dda-93fe-542c2285bafb";
|
||||||
|
|
||||||
|
fileSystems."/boot/efi" =
|
||||||
|
{ device = "/dev/disk/by-uuid/36B4-C473";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
53
hosts/desktops/io/kmonad.kbd
Normal file
53
hosts/desktops/io/kmonad.kbd
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
(defcfg
|
||||||
|
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
|
||||||
|
output (uinput-sink "KMonad Virtal Keyboard"
|
||||||
|
"/run/current-system/sw/bin/sleep 1 && /run/current-system/sw/bin/setxkbmap -option compose:ralt")
|
||||||
|
cmp-seq ralt
|
||||||
|
cmp-seq-delay 5
|
||||||
|
fallthrough true
|
||||||
|
allow-cmd false
|
||||||
|
)
|
||||||
|
|
||||||
|
(defalias
|
||||||
|
ovrvw M-w #|Overview button|#
|
||||||
|
cps (multi-tap 150 rsft caps) #|Caps lock replacement|#
|
||||||
|
medkey (multi-tap 200 KeyNextSong KeyPreviousSong) #|Play-pause key|#
|
||||||
|
mute (multi-tap 200 KeyMute M-KeyMute) #|Mute audio and mic|#
|
||||||
|
|
||||||
|
#|Handling function key|#
|
||||||
|
fk (layer-toggle fkeys)
|
||||||
|
fkk (layer-switch fkeys)
|
||||||
|
fks (multi-tap 200 @fk @fkk)
|
||||||
|
fkout (layer-switch default)
|
||||||
|
fko (multi-tap 200 @fk @fkout)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defsrc
|
||||||
|
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f13
|
||||||
|
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||||
|
tab q w e r t y u i o p [ ] ret
|
||||||
|
lmet a s d f g h j k l ; ' \
|
||||||
|
lsft 102d z x c v b n m , . / rsft
|
||||||
|
lctl lalt spc ralt rctl up
|
||||||
|
left down rght
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayer default
|
||||||
|
esc KeyBack KeyForward KeyRefresh f11 @ovrvw brdn brup @mute pp @medkey del
|
||||||
|
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||||
|
tab q w e r t y u i o p [ ] ret
|
||||||
|
lmet a s d f g h j k l ; ' \
|
||||||
|
lsft @fks z x c v b n m , . / @cps
|
||||||
|
lctl lalt spc ralt rctl up
|
||||||
|
left down rght
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayer fkeys
|
||||||
|
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
|
||||||
|
_ _ _ _ _ _ _ _ _ kp/ kp* kp- KeyHome _
|
||||||
|
_ prnt _ _ _ _ _ _ 7 8 9 kp+ pgup _
|
||||||
|
_ _ _ _ _ _ _ _ 4 5 6 kprt pgdn
|
||||||
|
_ @fko _ _ _ _ _ _ _ 1 2 3 KeyEnd
|
||||||
|
_ _ _ 0 . _
|
||||||
|
_ _ _
|
||||||
|
)
|
||||||
1
users/common.nix
Normal file
1
users/common.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
|
||||||
232
users/desktops/io/user.nix
Normal file
232
users/desktops/io/user.nix
Normal file
|
|
@ -0,0 +1,232 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
home = {
|
||||||
|
username = "user";
|
||||||
|
homeDirectory = "/home/user";
|
||||||
|
stateVersion = "22.05";
|
||||||
|
pointerCursor = {
|
||||||
|
size = 24;
|
||||||
|
gtk.enable = true;
|
||||||
|
x11.enable = true;
|
||||||
|
name = "breeze_cursors";
|
||||||
|
package = pkgs.breeze-icons;
|
||||||
|
};
|
||||||
|
packages = with pkgs; [
|
||||||
|
syncthingtray
|
||||||
|
];
|
||||||
|
sessionVariables = {
|
||||||
|
EDITOR = "micro";
|
||||||
|
NIXPKGS_ALLOW_UNFREE = "1";
|
||||||
|
};
|
||||||
|
file = {
|
||||||
|
# Dotfiles that can't be managed via home-manager
|
||||||
|
".scripts/pfetch" = {
|
||||||
|
executable = true;
|
||||||
|
source = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/baduhai/dotfiles/master/scripts/pfetch";
|
||||||
|
sha256 = "UEfTG1XCuN2GlpPz1gdQ5mxgutlX2XL58rGOqtaUgV4=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
".local/share/color-schemes/BreezeDarkNeutral.colors".source = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/baduhai/dotfiles/master/color-schemes/BreezeDarkNeutral.colors";
|
||||||
|
sha256 = "Fw5knhpV47HlgYvbHFzfi6M6Tk2DTlAuFUYc2WDDBc8=";
|
||||||
|
};
|
||||||
|
".config/MangoHud/MangoHud.conf".source = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/baduhai/dotfiles/master/MangoHud/MangoHud.conf";
|
||||||
|
sha256 = "WCRsS6njtU4aR7tMiX8oWa2itJyy04Zp7wfwV20SLZs=";
|
||||||
|
};
|
||||||
|
".config/kitty/search.py".source = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/baduhai/dotfiles/master/kitty/search.py";
|
||||||
|
sha256 = "mi5GB8CmWafAdp3GYnsQM4VHpXhuaVYX7YDT+9426Jc=";
|
||||||
|
};
|
||||||
|
".config/kitty/scroll_mark.py".source = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/baduhai/dotfiles/master/kitty/scroll_mark.py";
|
||||||
|
sha256 = "Abif6LIOCiXyDdQMZ4pQnLK++It0VYIM+WE7Oydwkfo=";
|
||||||
|
};
|
||||||
|
# Autostart programs
|
||||||
|
".config/autostart/org.kde.yakuake.desktop".source = config.lib.file.mkOutOfStoreSymlink "/var/run/current-system/sw/share/applications/org.kde.yakuake.desktop";
|
||||||
|
".config/autostart/megasync.desktop".source = config.lib.file.mkOutOfStoreSymlink "/var/run/current-system/sw/share/applications/megasync.desktop";
|
||||||
|
".config/autostart/koi.desktop".source = config.lib.file.mkOutOfStoreSymlink "/var/run/current-system/sw/share/applications/koi.desktop";
|
||||||
|
# Fix flatpak fonts, themes, icons and cursor
|
||||||
|
".icons/breeze_cursors".source = config.lib.file.mkOutOfStoreSymlink "/run/current-system/sw/share/icons/breeze_cursors";
|
||||||
|
".local/share/flatpak/overrides/global".text = "[Context]\nfilesystems=/run/current-system/sw/share/X11/fonts:ro;~/.local/share/color-schemes:ro;xdg-config/gtk-3.0:ro;/nix/store:ro;~/.icons:ro";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts.fontconfig.enable = true; # Allow fonts installed by home-manager to be available session wide
|
||||||
|
|
||||||
|
gtk = {
|
||||||
|
enable = true;
|
||||||
|
font = { name = "Inter"; size = 10; };
|
||||||
|
theme = { package = pkgs.breeze-gtk; name = "Breeze"; };
|
||||||
|
iconTheme = { package = pkgs.breeze-icons; name = "Breeze"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
kdeconnect.enable = true;
|
||||||
|
syncthing = {
|
||||||
|
enable = true;
|
||||||
|
tray = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.writeShellScriptBin "syncthingtray" "exec ${pkgs.syncthingtray}/bin/syncthingtray --wait" // { pname = "syncthingtray"; }; # Override synctray so it waits for a system tray
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home-manager.autoUpgrade = { # Auto upgrade home-manager, unsure if this works or not
|
||||||
|
enable = true;
|
||||||
|
frequency = "*-*-* 20:00:00";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
desktopEntries = {
|
||||||
|
steamGamepadUi = { # Menu entry for steam gamepad ui
|
||||||
|
terminal = false;
|
||||||
|
icon = "steam_deck";
|
||||||
|
exec = "steam -gamepadui";
|
||||||
|
name = "Steam (Gamepad UI)";
|
||||||
|
categories = [ "Game" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
home-manager.enable = true;
|
||||||
|
password-store = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.pass-wayland;
|
||||||
|
};
|
||||||
|
bash = {
|
||||||
|
enable = true;
|
||||||
|
historyFile = "~/.cache/bash_history";
|
||||||
|
};
|
||||||
|
micro = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
clipboard = "terminal";
|
||||||
|
mkparents = true;
|
||||||
|
scrollbar = true;
|
||||||
|
tabstospaces = true;
|
||||||
|
tabsize = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
fish = {
|
||||||
|
enable = true;
|
||||||
|
interactiveShellInit = "any-nix-shell fish --info-right | source";
|
||||||
|
loginShellInit = "any-nix-shell fish --info-right | source";
|
||||||
|
shellAliases = {
|
||||||
|
d = "kitty +kitten diff";
|
||||||
|
nano = "micro";
|
||||||
|
wget = "wget --hsts-file=\"$XDG_DATA_HOME/wget-hsts\"";
|
||||||
|
ssh = "kitty +kitten ssh";
|
||||||
|
};
|
||||||
|
functions = {
|
||||||
|
fish_greeting = ''
|
||||||
|
set -x PF_INFO ascii title os kernel uptime wm memory palette
|
||||||
|
eval $HOME/.scripts/pfetch
|
||||||
|
'';
|
||||||
|
tsh = "ssh -o RequestTTY=yes $argv tmux -u -CC new -A -s tmux-main";
|
||||||
|
pacin = "nix-env -iA nixos.$argv";
|
||||||
|
pacre = "nix-env -e $argv";
|
||||||
|
trizen = "nix search nixpkgs $argv";
|
||||||
|
rebuild = "rm ~/.gtkrc-2.0; sudo nixos-rebuild switch --flake '/home/user/Projects/nix-config#'";
|
||||||
|
rebuild-boot = "rm ~/.gtkrc-2.0; sudo nixos-rebuild boot --flake '/home/user/Projects/nix-config#'";
|
||||||
|
upgrade = "rm ~/.gtkrc-2.0; nix flake update --commit-lock-file /home/user/Projects/nix-config; sudo nixos-rebuild switch --upgrade --flake '/home/user/Projects/nix-config#'";
|
||||||
|
upgrade-boot = "rm ~/.gtkrc-2.0; nix flake update --commit-lock-file /home/user/Projects/nix-config; sudo nixos-rebuild boot --upgrade --flake '/home/user/Projects/nix-config#'";
|
||||||
|
};
|
||||||
|
shellInit = ''
|
||||||
|
set -g PF_INFO ascii title os kernel uptime wm memory palette
|
||||||
|
set -g theme_date_format "+%H:%M"
|
||||||
|
set -g theme_date_timezone Europe/Berlin
|
||||||
|
set -g theme_avoid_ambiguous_glyphs yes
|
||||||
|
set -g theme_color_scheme dark
|
||||||
|
set -g theme_nerd_fonts yes
|
||||||
|
set -g theme_display_git_default_branch yes
|
||||||
|
set -g -x FONTCONFIG_FILE ${pkgs.fontconfig.out}/etc/fonts/fonts.conf
|
||||||
|
'';
|
||||||
|
plugins = [
|
||||||
|
{
|
||||||
|
name = "bobthefish";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "oh-my-fish";
|
||||||
|
repo = "theme-bobthefish";
|
||||||
|
rev = "2dcfcab653ae69ae95ab57217fe64c97ae05d8de";
|
||||||
|
sha256 = "jBbm0wTNZ7jSoGFxRkTz96QHpc5ViAw9RGsRBkCQEIU=";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "bang-bang";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "oh-my-fish";
|
||||||
|
repo = "plugin-bang-bang";
|
||||||
|
rev = "f969c618301163273d0a03d002614d9a81952c1e";
|
||||||
|
sha256 = "A8ydBX4LORk+nutjHurqNNWFmW6LIiBPQcxS3x4nbeQ=";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "fzf.fish";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "PatrickF1";
|
||||||
|
repo = "fzf.fish";
|
||||||
|
rev = "v9.2";
|
||||||
|
sha256 = "XmRGe39O3xXmTvfawwT2mCwLIyXOlQm7f40mH5tzz+s=";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
btop = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
color_theme = "gruvbox_dark.theme";
|
||||||
|
theme_background = false;
|
||||||
|
proc_sorting = "cpu direct";
|
||||||
|
update_ms = 500;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
kitty = {
|
||||||
|
enable = true;
|
||||||
|
theme = "Afterglow";
|
||||||
|
font = {
|
||||||
|
name = "Hack Nerd Font";
|
||||||
|
size = 10;
|
||||||
|
};
|
||||||
|
keybindings = {
|
||||||
|
"kitty_mod+f" = "launch --location=hsplit --allow-remote-control kitty +kitten search.py @active-kitty-window-id";
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
clipboard_control = "write-clipboard read-clipboard write-primary read-primary";
|
||||||
|
confirm_os_window_close = "-2";
|
||||||
|
cursor_shape = "block";
|
||||||
|
initial_window_height = "570";
|
||||||
|
initial_window_width = "120c";
|
||||||
|
remember_window_size = "no";
|
||||||
|
tab_bar_background = "#3b3b3b";
|
||||||
|
tab_bar_margin_color = "#3b3b3b";
|
||||||
|
tab_bar_margin_height = "3 3";
|
||||||
|
tab_bar_margin_width = 2;
|
||||||
|
tab_bar_min_tabs = 1;
|
||||||
|
tab_bar_style = "fade";
|
||||||
|
tab_fade = 0;
|
||||||
|
tab_switch_strategy = "left";
|
||||||
|
tab_title_template = "{fmt.bg._3b3b3b}{fmt.fg._202020}{fmt.fg.default}{fmt.bg._202020}{fmt.fg._c6c6c6} {title} {fmt.fg.default}{fmt.bg.default}{fmt.fg._202020}{fmt.fg.default}";
|
||||||
|
active_tab_title_template = "{fmt.bg._3b3b3b}{fmt.fg._fcfcfc}{fmt.fg.default}{fmt.bg._fcfcfc}{fmt.fg._3b3b3b} {title} {fmt.fg.default}{fmt.bg.default}{fmt.fg._fcfcfc}{fmt.fg.default}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tmux = {
|
||||||
|
enable = true;
|
||||||
|
clock24 = true;
|
||||||
|
extraConfig = "set -g mouse on";
|
||||||
|
};
|
||||||
|
git = {
|
||||||
|
enable = true;
|
||||||
|
diff-so-fancy.enable = true;
|
||||||
|
userName = "William";
|
||||||
|
userEmail = "williamhai@hotmail.com";
|
||||||
|
};
|
||||||
|
mangohud = {
|
||||||
|
enable = true;
|
||||||
|
enableSessionWide = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue