Compare commits

..

10 Commits

2 changed files with 137 additions and 23 deletions

12
flake.lock generated
View File

@@ -8,11 +8,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1673089714, "lastModified": 1673815682,
"narHash": "sha256-D58SGNOVe+s7r2iewnCA8q68gyrfQcOnD1TdJo1wFLY=", "narHash": "sha256-zG7Rroki+89poCTr1D8BM/wTCl+DZJvU4IUE+5hxG7U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "9e565f0d9d41c19a94f55af205c328ec5177fc0a", "rev": "3e42035fc013ed4d8af6ee8dc0079c0c551c45a5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -23,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1672953546, "lastModified": 1673631141,
"narHash": "sha256-oz757DnJ1ITvwyTovuwG3l9cX6j9j6/DH9eH+cXFJmc=", "narHash": "sha256-AprpYQ5JvLS4wQG/ghm2UriZ9QZXvAwh1HlgA/6ZEVQ=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a518c77148585023ff56022f09c4b2c418a51ef5", "rev": "befc83905c965adfd33e5cae49acb0351f6e0404",
"type": "github" "type": "github"
}, },
"original": { "original": {

148
flake.nix
View File

@@ -12,11 +12,6 @@
outputs = { self, nixpkgs, home-manager }@attrs: outputs = { self, nixpkgs, home-manager }@attrs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [];
};
homeManagerSharedModule = { homeManagerSharedModule = {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.users.nathan = { config, pkgs, lib, ... }:{ home-manager.users.nathan = { config, pkgs, lib, ... }:{
@@ -89,6 +84,26 @@
nnoremap <leader>q :q<CR> nnoremap <leader>q :q<CR>
inoremap jk <Esc> inoremap jk <Esc>
inoremap kj <Esc> inoremap kj <Esc>
" Thanks to https://unix.stackexchange.com/questions/140898/vim-hide-status-line-in-the-bottom
let s:hidden_all = 0
function! ToggleHiddenAll()
if s:hidden_all == 0
let s:hidden_all = 1
set noshowmode
set noruler
set laststatus=0
set noshowcmd
else
let s:hidden_all = 0
set showmode
set ruler
set laststatus=2
set showcmd
endif
endfunction
nnoremap <S-h> :call ToggleHiddenAll()<CR>
''; '';
}; };
programs.tmux = { programs.tmux = {
@@ -132,9 +147,48 @@
setw -g mode-keys vi setw -g mode-keys vi
''; '';
}; };
programs.emacs = {
enable = true;
extraConfig = ''
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
;; Use spaces, not tabs, for indentation.
(setq-default indent-tabs-mode nil)
;; Highlight matching pairs of parentheses.
(setq show-paren-delay 0)
(show-paren-mode)
(setq evil-want-C-u-scroll t)
(evil-mode 1)
(evil-set-undo-system 'undo-redo)
(setq key-chord-two-keys-delay 0.5)
(key-chord-define evil-insert-state-map "jk" 'evil-normal-state)
(key-chord-mode 1)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("3ff4a0ad1a2da59a72536e6030291cf663314c14c8a5a9eb475f3c28436d071d" default)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(load-theme 'dracula t)
'';
extraPackages = epkgs: with epkgs; [ evil key-chord magit proof-general paredit rainbow-delimiters dracula-theme ];
}; };
}; };
commonConfigFunc = ({ config, lib, pkgs, modulesPath, ... }: { };
commonConfigFunc = ({ config, lib, pkgs, modulesPath, ... }: (specificPkgs: {
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
users.extraUsers.nathan = { users.extraUsers.nathan = {
@@ -159,6 +213,10 @@
extraPortals = [pkgs.xdg-desktop-portal-gtk ]; extraPortals = [pkgs.xdg-desktop-portal-gtk ];
gtkUsePortal = true; gtkUsePortal = true;
}; };
services.blueman.enable = true;
services.printing.enable = true;
services.printing.drivers = [ pkgs.brlaser ];
programs.sway = { programs.sway = {
enable = true; enable = true;
@@ -166,7 +224,7 @@
extraPackages = with pkgs; [ extraPackages = with pkgs; [
swaylock # lockscreen swaylock # lockscreen
swayidle swayidle
#xwayland # for legacy apps xwayland # for legacy apps
#waybar # status bar #waybar # status bar
mako # notification daemon mako # notification daemon
kanshi # autorandr kanshi # autorandr
@@ -180,14 +238,16 @@
"sway/config".source = ./sway_config; "sway/config".source = ./sway_config;
}; };
}; };
# For steam, and Vulkan in general
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
tmux vim wget curl git w3m iftop killall file unzip zip ripgrep imv killall gomuks htop tmux vim wget curl git w3m iftop iotop killall file unzip zip ripgrep imv killall gomuks htop
firefox-wayland chromium gnome.nautilus firefox-wayland chromium gnome.nautilus
calibre foliate transmission-gtk mupdf vlc steam calibre foliate transmission-gtk mupdf
pywal gimp
foot pavucontrol pywal
foot
sway wayland glib dracula-theme gnome.adwaita-icon-theme swaylock swayidle wl-clipboard sway wayland glib dracula-theme gnome.adwaita-icon-theme swaylock swayidle wl-clipboard
(pkgs.writeTextFile { (pkgs.writeTextFile {
name = "dbus-sway-environment"; name = "dbus-sway-environment";
@@ -219,7 +279,7 @@
gsettings set $gnome_schema gtk-theme 'Dracula' gsettings set $gnome_schema gtk-theme 'Dracula'
''; '';
}) })
]; ] ++ specificPkgs;
programs.waybar.enable = true; programs.waybar.enable = true;
# kanshi systemd service # kanshi systemd service
@@ -239,25 +299,78 @@
services.openssh.enable = true; services.openssh.enable = true;
networking.firewall.enable = false; networking.firewall.enable = false;
system.stateVersion = "22.11"; # Did you read the comment? }));
});
in { in {
nixosConfigurations.nixos4800H = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = attrs;
modules = [
home-manager.nixosModules.home-manager
homeManagerSharedModule
({ config, lib, pkgs, modulesPath, ... }@innerArgs: (lib.recursiveUpdate (commonConfigFunc innerArgs [ pkgs.light ]) {
# HARDWARE
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = { device = "/dev/disk/by-uuid/ae8e4a92-53dd-49b5-bf3a-aeb9a109c01e"; fsType = "ext4"; };
fileSystems."/boot" = { device = "/dev/disk/by-uuid/28E9-0409"; fsType = "vfat"; };
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 16;
# END HARDWARE
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "nixos4800H"; # Define your hostname.
# THIS SEEMS CONTRADICTORY
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.eno1.useDHCP = true;
networking.interfaces.wlp1s0.useDHCP = true;
networking.wireguard.interfaces = {
wg0 = {
ips = [ "10.100.0.7/24" ];
privateKeyFile = "/home/nathan/wireguard-keys/private";
peers = [
{
publicKey = "WXx7XXJzerPJBPMTvZ454iQhx5Q5bFvBgF6NsPPX9nk=";
allowedIPs = [ "10.100.0.0/24" ];
#allowedIPs = [ "0.0.0.0/0" ];
## Then sudo ip route add 104.238.179.164 via 10.0.0.1 dev enp30s0
endpoint = "104.238.179.164:51820";
persistentKeepalive = 25;
}
];
};
};
system.stateVersion = "20.03";
}))
];
};
nixosConfigurations.nixos-desktop = nixpkgs.lib.nixosSystem { nixosConfigurations.nixos-desktop = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = attrs; specialArgs = attrs;
modules = [ modules = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
homeManagerSharedModule homeManagerSharedModule
({ config, lib, pkgs, modulesPath, ... }@innerArgs: (lib.recursiveUpdate (commonConfigFunc innerArgs) { ({ config, lib, pkgs, modulesPath, ... }@innerArgs: (lib.recursiveUpdate (commonConfigFunc innerArgs []) {
# HARDWARE # HARDWARE
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "ntfs" ];
fileSystems."/" = { device = "/dev/disk/by-uuid/163c1731-2f66-436b-a74f-20f84ec628dd"; fsType = "ext4"; }; fileSystems."/" = { device = "/dev/disk/by-uuid/163c1731-2f66-436b-a74f-20f84ec628dd"; fsType = "ext4"; };
fileSystems."/boot" = { device = "/dev/disk/by-uuid/9C44-5411"; fsType = "vfat"; }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/9C44-5411"; fsType = "vfat"; };
#fileSystems."/big_disk" = { device = "/dev/disk/by-uuid/B610D69310D65A47"; fsType = "ntfs3"; options = ["rw" "uid=1000"]; };
swapDevices = [ ]; swapDevices = [ ];
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
@@ -267,6 +380,7 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos-desktop"; # Define your hostname. networking.hostName = "nixos-desktop"; # Define your hostname.
system.stateVersion = "22.11";
})) }))
]; ];
}; };