Switch to NixOS and various fixes

This commit is contained in:
Filippo Berto 2021-05-17 14:57:10 +02:00
parent c7df83869f
commit 0aae761f89
14 changed files with 222 additions and 130 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
config.nix

View file

@ -1,18 +1,19 @@
# Nord palette
{
nord0 = "#2e3440";
nord1 = "#3b4252";
nord2 = "#434c5e";
nord3 = "#4c566a";
nord4 = "#d8dee9";
nord5 = "#e5e9f0";
nord6 = "#eceff4";
nord7 = "#8fbcbb";
nord8 = "#88c0d0";
nord9 = "#81a1c1";
nord10 = "#5e81ac";
nord11 = "#bf616a";
nord12 = "#d08770";
nord13 = "#ebcb8b";
nord14 = "#a3be8c";
nord15 = "#b48ead";
n0 = "#2e3440";
n1 = "#3b4252";
n2 = "#434c5e";
n3 = "#4c566a";
n4 = "#d8dee9";
n5 = "#e5e9f0";
n6 = "#eceff4";
n7 = "#8fbcbb";
n8 = "#88c0d0";
n9 = "#81a1c1";
n10 = "#5e81ac";
n11 = "#bf616a";
n12 = "#d08770";
n13 = "#ebcb8b";
n14 = "#a3be8c";
n15 = "#b48ead";
}

38
fstab
View file

@ -1,38 +0,0 @@
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p3 @root
UUID=9b9ae9dd-d889-4457-a7a5-02895db5f213 / btrfs rw,relatime,ssd,space_cache,compress=lzo,subvolid=256,subvol=/@root,subvol=@root 0 0
# /dev/nvme0n1p1
UUID=2D5C-D6EA /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme0n1p2
UUID=c35f5ed9-5dc6-4924-9e85-da2eedf833f3 none swap defaults 0 0
# /dev/nvme0n1p3 @opt
UUID=9b9ae9dd-d889-4457-a7a5-02895db5f213 /opt btrfs rw,relatime,ssd,space_cache,compress=lzo,subvol=/@opt,subvol=@opt 0 0
# /dev/sda1 @bertof
UUID=9b9ae9dd-d889-4457-a7a5-02895db5f213 /home/bertof btrfs rw,relatime,space_cache,compress=lzo,subvolid=33741,subvol=/@bertof,subvol=@bertof 0 0
# /dev/sda1 @bertof_images
UUID=70fc256d-6782-415a-af59-65e6c059194e /home/bertof/Immagini btrfs rw,relatime,space_cache,compress=lzo,subvol=/@bertof_images,subvol=@bertof_images,x-gvfs-hide 0 0
# /dev/sda1 @bertof_videos
UUID=70fc256d-6782-415a-af59-65e6c059194e /home/bertof/Video btrfs rw,relatime,space_cache,compress=lzo,subvol=/@bertof_videos,subvol=@bertof_videos,x-gvfs-hide 0 0
# /dev/sda1 @bertof_music
UUID=70fc256d-6782-415a-af59-65e6c059194e /home/bertof/Musica btrfs rw,relatime,space_cache,compress=lzo,subvol=/@bertof_music,subvol=@bertof_music,x-gvfs-hide 0 0
# /dev/sda1 @bertof_downloads
UUID=70fc256d-6782-415a-af59-65e6c059194e /home/bertof/Scaricati btrfs rw,relatime,space_cache,compress=lzo,subvol=/@bertof_downloads,subvol=@bertof_downloads,x-gvfs-hide 0 0
# /dev/nvme0n1p3 @games
UUID=9b9ae9dd-d889-4457-a7a5-02895db5f213 /home/bertof/Giochi/SSD btrfs rw,relatime,ssd,space_cache,compress=lzo,subvol=/@games,subvol=@games,x-gvfs-hide 0 0
# /dev/sda1 @games
UUID=70fc256d-6782-415a-af59-65e6c059194e /home/bertof/Giochi/HDD btrfs rw,relatime,ssd,space_cache,compress=lzo,subvol=/@games,subvol=@games,x-gvfs-hide 0 0

View file

@ -1,28 +1,42 @@
{ pkgs, ... }:
let
unstable = import <nixos-unstable> {};
nixpkgs = import <nixpkgs> {};
colorscheme.theme = import ./packages/nord.nix;
in {
fonts.fontconfig = {
enable = true;
};
nixpkgs.config = import ./modules/config.nix;
xdg.configFile."nixpkgs/config.nix".source = ./modules/config.nix;
home = {
language.base = "it_IT.UTF-8";
keyboard.layout = "it";
keyboard.options = ["terminate:ctrl_alt_bksp" "compose:rctrl"];
packages = with pkgs; [
nerdfonts
spotify
packages = (with pkgs; [
htop
neofetch
discord
evolutionWithPlugins
firefox
gnome3.evince
gnome3.nautilus
jetbrains.datagrip
megasync
mpv
nerdfonts
pavucontrol
pcmanfm
polybarFull
procps-ng
mmv-go
terminator
];
skypeforlinux
slack
spotify
teams
]) ++ (with nixpkgs; [
authy
keepassxc
tdesktop
]);
};
imports = [
@ -31,11 +45,13 @@ in {
./modules/broot.nix
./modules/bottom.nix
./modules/dircolors.nix
./modules/fzf.nix
./modules/dunst.nix
# ./modules/fzf.nix
./modules/git.nix
./modules/go.nix
./modules/gpg.nix
./modules/kakoune.nix
./modules/picom.nix
./modules/qogir_theme.nix
./modules/rofi.nix
./modules/screen_locker.nix
@ -53,6 +69,9 @@ in {
# };
};
services.gnome-keyring.enable = true;
services.blueman-applet.enable = true;
services.network-manager-applet.enable = true;
xsession.numlock.enable = true;
}

View file

@ -1,4 +1,9 @@
{
{ pkgs, ... }:
let
nord = import ../configs/themes/nord.nix;
in {
# Include fonts packages
home.packages = with pkgs; [ nerdfonts ];
programs.alacritty = {
enable = true;
settings = {
@ -16,51 +21,51 @@
# NORD Theme: https://github.com/arcticicestudio/nord-alacritty
colors = {
primary = {
background = "#2e3440";
foreground = "#d8dee9";
dim_foreground = "#a5abb6";
background = nord.n0;
foreground = nord.n6;
dim_foreground = nord.n4;
};
cursor = {
text = "#2e3440";
cursor = "#d8dee9";
text = nord.n0;
cursor = nord.n4;
};
vi_mode_cursor = {
text = "#2e3440";
cursor = "#d8dee9";
text = nord.n0;
cursor = nord.n4;
};
selection = {
text = "CellForeground";
background = "#4c566a";
background = nord.n3;
};
search = {
matches = {
foreground = "CellForeground";
background = "#88c0d0";
background = nord.n8;
};
bar = {
background = "#434c5e";
foreground = "#d8dee9";
background = nord.n2;
foreground = nord.n4;
};
};
normal = {
black = "#3b4252";
red = "#bf616a";
green = "#a3be8c";
yellow = "#ebcb8b";
blue = "#81a1c1";
magenta = "#b48ead";
cyan = "#88c0d0";
white = "#e5e9f0";
black = nord.n1;
red = nord.n11;
green = nord.n14;
yellow = nord.n13;
blue = nord.n9;
magenta = nord.n15;
cyan = nord.n9;
white = nord.n5;
};
bright = {
black = "#4c566a";
red = "#bf616a";
green = "#a3be8c";
yellow = "#ebcb8b";
blue = "#81a1c1";
magenta = "#b48ead";
cyan = "#8fbcbb";
white = "#eceff4";
black = nord.n3;
red = nord.n11;
green = nord.n14;
yellow = nord.n13;
blue = nord.n9;
magenta = nord.n15;
cyan = nord.n8;
white = nord.n6;
};
dim = {
black = "#373e4d";

View file

@ -1,8 +1,9 @@
{ pkgs, lib, ... }:
let
unstable = import <nixpkgs> {};
tomlGenerate = (pkgs.formats.toml {}).generate "bottom-toml";
in {
home.packages = [ pkgs.bottom ];
home.packages = with unstable; [ bottom ];
xdg.configFile."bottom/bottom.toml".source = tomlGenerate {
"flags" = {
"left_legend" = true;

84
modules/dunst.nix Normal file
View file

@ -0,0 +1,84 @@
{ pkgs, ... }:
let rofi_dmenu = "${pkgs.rofi} -dmenu";
firefox = "${pkgs.firefox}/bin/firefox";
dmenu = "${pkgs.dmenu}/bin/dmenu";
in {
home.packages = with pkgs; [ dunst nerdfonts ];
services.dunst = {
enable = true;
iconTheme = {
package = pkgs.qogir-icon-theme;
name = "Qogir-dark";
};
settings = {
global = {
monitor = 0;
follow = "keyboard";
geometry = "300x6-20+50";
indicate_hidden = "yes";
shrink = "yes";
transparency = 10;
notification_height = 0;
separator_height = 2;
padding = 8;
horizontal_padding = 8;
frame_width = 2;
frame_color = "#2E3440";
separator_color = "#404859";
sort = "yes";
idle_threshold = 120;
font = "FuraCode Nerd Font Mono 10";
line_height = 0;
markup = "full";
format = "<b>%s</b>\\n%b";
alignment = "left";
show_age_threshold = 60;
word_wrap = "yes";
ellipsize = "middle";
ignore_newline = "no";
stack_duplicates = "true";
hide_duplicate_count = "false";
show_indicators = "yes";
icon_position = "off";
max_icon_size = 32;
sticky_history = "yes";
history_length = 20;
dmenu = "${dmenu} -p dunst:";
browser = "${firefox} -new-tab";
always_run_script = "true";
title = "Dunst";
class = "Dunst";
startup_notification = "false";
verbosity = "mesg";
corner_radius = 0;
force_xinerama = "false";
mouse_left_click = "close_current";
mouse_middle_click = "do_action";
mouse_right_click = "close_all";
};
urgency_low = {
background = "#2E3440";
foreground = "#D8DEE9";
timeout = 10;
};
urgency_normal = {
background = "#2E3440";
foreground = "#D8DEE9";
timeout = 10;
};
urgency_critical = {
background = "#2E3440";
foreground = "#D8DEE9";
frame_color = "#ff0000";
timeout = 0;
};
shortcuts = {
close = "ctrl+space";
close_all = "ctrl+shift+space";
history = "ctrl+backslash";
context = "ctrl+shift+period";
};
};
};
}

View file

@ -1 +0,0 @@

View file

@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }:
let
unstable = import <nixos-unstable> {};
nixpkgs = import <nixpkgs> {};
in {
home.packages = with pkgs; [
kak-lsp
@ -8,6 +8,11 @@ in {
gocode
gogetdoc
jq
aspell
aspellDicts.it
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
];
programs.kakoune = {
@ -66,11 +71,12 @@ in {
"require-module auto-pairs"
"require-module powerline"
];
plugins = with pkgs.kakounePlugins; [
plugins = (with pkgs.kakounePlugins; [
kak-auto-pairs
unstable.kakounePlugins.powerline-kak
unstable.kakounePlugins.prelude-kak
];
]) ++ (with nixpkgs; [
kakounePlugins.prelude-kak
kakounePlugins.powerline-kak
]);
};
xdg.configFile."kak-lsp/kak-lsp.toml".source = ../configs/kak-lsp/kak-lsp.toml;

10
modules/picom.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
services.picom = {
enable = true;
blur = true;
fade = true;
shadow = true;
vSync = true;
};
}

View file

@ -4,8 +4,9 @@
enable = true;
font = {
package = pkgs.cantarell-fonts;
name = "Cantarell";
size = 9;
# name = "Cantarell";
# size = 9;
name = "Cantarell 9";
};
iconTheme = {
package = pkgs.qogir-icon-theme;

View file

@ -1,10 +1,14 @@
{
programs.rofi = {
enable = true;
extraConfig = {
modi = "drun,run,ssh,window";
theme = "nord";
};
# extraConfig = {
# modi = "drun,run,ssh,window";
# theme = "nord";
# };
extraConfig = "
modi = drun,run,ssh,window
theme = nord
";
};
xdg.configFile."rofi/nord.rasi".source = ../configs/rofi/nord.rasi;

View file

@ -10,7 +10,7 @@
terminator
rofi
bash
# betterlockscreen
betterlockscreen
];
services.sxhkd = let
@ -24,7 +24,7 @@
terminator= "${pkgs.terminator}/bin/terminator";
rofi = "${pkgs.rofi}/bin/rofi";
bash = "${pkgs.bash}/bin/bash";
betterlockscreen = "/usr/bin/betterlockscreen";
betterlockscreen = "betterlockscreen";
in {
enable = true;
keybindings = {