return to nixos

This commit is contained in:
horhik 2021-08-26 09:47:50 +03:00
parent f4ad8bd499
commit 3d4698b954
9 changed files with 60 additions and 8 deletions

43
nix/README.md Normal file
View File

@ -0,0 +1,43 @@
# NixOS setup
1. Backup your old config
```bash
$ sudo mv /etc/nixos /etc/nixos.old
```
2. Copy repo and symlink new config from dotfiles
```bash
$ git clone https://github.com/horhik/dotfiles
$ cd dotfiles
$ sudo ln -s $HOME/dotfiles/nix /etc/nixos
```
3. Past your hardware-configuration
```bash
$ sudo cp /etc/nixos.old/hardware-configuration.nix /etc/nixos/
```
4. Install home-manager
```bash
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-21.05.tar.gz home-manager
$ nix-channel --update
export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH
$ nix-shell '<home-manager>' -A install
```
5. Copy dotfiles
```bash
stow --adopt -vt ~ $HOME/dotfiles/home/*
```
6. Build nixos
```bash
cd /etc/nixos
sudo nixos-rebuild build --flake "#."
```

View File

@ -121,7 +121,7 @@
mononoki fontmatrix mononoki fontmatrix
firefox firefox
connman connman
wpa_supplicant python3 xkblayout-state acpi yaru-theme wpa_supplicant python3 xkblayout-state acpi yaru-theme xkb-switch
pipewire pulsemixer nerdfonts pipewire pulsemixer nerdfonts
feh compton ninja meson cmake feh compton ninja meson cmake
anki clang_12 zathura redshift rustup neofetch tree anki clang_12 zathura redshift rustup neofetch tree
@ -131,6 +131,7 @@
spotify obsidian discord spotify obsidian discord
nfs-utils cifs-utils nfs-utils cifs-utils
nfs-ganesha nfs-ganesha
transmission
]; ];
# Some programs need SUID wrappers, can be configured further or are # Some programs need SUID wrappers, can be configured further or are
@ -219,7 +220,7 @@
nixpkgs.overlays = [ nixpkgs.overlays = [
(import (builtins.fetchTarball { (import (builtins.fetchTarball {
url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz; url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
sha256 = "0c2p2ycx6c50rzfd5k56cc411cb0ilhc3zyhhxlwcjnz1ysn5laj"; sha256 = "039kk45r6pqsfd865lgfiwbaqlpll4p9pmndbzhi6l5w5r8dbabm";
})) }))
]; ];
} }

View File

@ -74,9 +74,12 @@
imports = [ imports = [
./modules/picom.nix ./modules/picom.nix
./modules/tmux.nix ./modules/tmux.nix
./modules/bspwm
]; ];
}; };
}) })
{ nixpkgs.overlays = overlays; }
]; ];
inherit pkgs; inherit pkgs;
}; };

View File

@ -14,17 +14,17 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/1dd41f8e-142f-4799-a5e5-cc916cf016c1"; { device = "/dev/disk/by-uuid/906b2b92-4e31-4a91-938f-14ac752dffe7";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/7555-74BA"; { device = "/dev/disk/by-uuid/8200-D543";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/4d03f0d2-c4d2-4f50-9b0c-86ab4df15cfd"; } [ { device = "/dev/disk/by-uuid/98b5b158-730a-470c-95f1-d8a32ebff9ad"; }
]; ];
} }

5
nix/modules/bspwm.nix Normal file
View File

@ -0,0 +1,5 @@
{ pkgs, ... }:
{
services.xserver.windowManager.bspwm.enable = true;
home.packages = [pkgs.sxhdkd];
}

View File

@ -74,7 +74,7 @@
rounded-corners-exclude = [ rounded-corners-exclude = [
"window_type = 'dock'", "window_type = 'dock'",
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'", "_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'",
"class_g = 'keynav'", "class_g = 'keynav'"
]; ];
round-borders = 0; round-borders = 0;
round-borders-exclude = [ round-borders-exclude = [

View File

@ -1,8 +1,8 @@
{config, pkgs, ...}: {config, pkgs, ...}:
programs.tmux = { {
enable = true; enable = true;
clock24 = true; clock24 = true;
extraPackages = tmuxPlugins : [tmux-gruvbox.gruvbox ]; home.packages = [pkgs.tmuxPlugins.gruvbox ];
extraTmuxConf = '' extraTmuxConf = ''
set -g @plugin 'egel/tmux-gruvbox' set -g @plugin 'egel/tmux-gruvbox'
set -g @tmux-gruvbox 'dark' # or 'light' set -g @tmux-gruvbox 'dark' # or 'light'