Compare commits

...

43 Commits

Author SHA1 Message Date
8b88bc178a Move waybar to subfolder
All checks were successful
pre-commit / pre-commit (push) Successful in 2m8s
2024-03-06 09:40:00 +01:00
01a47497db Change monitor ports 2024-03-06 08:53:55 +01:00
d375bf295a Run nix flake update 2024-03-06 01:15:51 +01:00
0360a994c9 Improve backup script 2024-03-06 01:15:04 +01:00
ad9656072c Add lsp for js/ts 2024-03-05 22:54:24 +01:00
e0e927edb1 Add lsp for .lua 2024-03-05 22:49:06 +01:00
405080b22d Add lsp for .nix 2024-03-05 22:33:29 +01:00
89362838dc Fix backup-home service 2024-03-05 22:15:31 +01:00
e2f45ccc42 Switch to unstable hyprland 2024-03-05 22:14:24 +01:00
f54d519ab1 Add mpv 2024-03-05 15:56:15 +01:00
ef1843801f Add nfs mount 2024-03-05 15:54:53 +01:00
ffc6e57b23 Add nfs mount 2024-03-05 15:42:52 +01:00
03cbf084e0 Add backup home service and timer 2024-03-05 14:52:04 +01:00
5f48a0ab51 Add backup script 2024-03-05 08:49:26 +01:00
fc677c6270 Improve neovim setup 2024-03-05 08:26:26 +01:00
13d8a1b162 Add obs stuff 2024-03-05 01:22:53 +01:00
74311f01f8 use unstable.zoom-us 2024-03-05 00:05:30 +01:00
3d533cd90f Add unstable overlay 2024-03-05 00:03:33 +01:00
f07853ac05 Improve hyprland config 2024-03-04 23:56:22 +01:00
8e46ecdb3a Add sshfs 2024-03-04 23:56:11 +01:00
71dcf157a5 Change monitor stuff 2024-03-04 16:15:04 +01:00
d32656069a Change ptt bind 2024-03-04 11:51:51 +01:00
eba67abc2a add randomwp 2024-03-04 09:10:58 +01:00
705c9ba011 Add ssh config 2024-03-04 08:14:08 +01:00
c11bc57eb2 Flake update
All checks were successful
pre-commit / pre-commit (push) Successful in 2m10s
2024-03-04 04:27:33 +01:00
08ad72c933 Temporary steam config 2024-03-04 04:24:34 +01:00
bb9bb49940 Add separate steam user 2024-03-03 13:06:22 +01:00
70d37cc0e1 add some i3 stuff 2024-03-03 12:57:27 +01:00
f0538e191d change ptt stuff 2024-03-03 12:57:13 +01:00
40332b46df Add i3 2024-03-03 10:14:09 +01:00
9cc4631fa6 Less noisy boot 2024-03-03 09:08:27 +01:00
3c0f25d61f Add cursor 2024-03-03 08:52:23 +01:00
87ff39bb86 Add pulseaudio for zoom 2024-03-03 07:25:37 +01:00
70cec6f3c6 Add rofi 2024-03-03 07:16:13 +01:00
1fbed0bf8a Add kitty macchiato theme 2024-03-03 06:15:10 +01:00
9b7ce0260c Run linting 2024-03-03 05:31:33 +01:00
f79aec6f00 nix flake update 2024-03-03 00:03:47 +01:00
ce1ea8959f add small shell script 2024-03-03 00:03:22 +01:00
35ada16dcb Add shell script test 2024-03-02 23:28:59 +01:00
9f5f770409 More gunter stuff 2024-03-02 22:20:09 +01:00
c0479068ed add kitty conf 2024-03-02 21:46:31 +01:00
f0842bf343 Multiple changes for gunter 2024-03-02 21:16:23 +01:00
b3423e8472 Add gunter stuff 2024-03-02 14:59:57 +01:00
34 changed files with 1040 additions and 101 deletions

32
flake.lock generated
View File

@ -7,26 +7,43 @@
]
},
"locked": {
"lastModified": 1709204054,
"narHash": "sha256-U1idK0JHs1XOfSI1APYuXi4AEADf+B+ZU4Wifc0pBHk=",
"lastModified": 1706981411,
"narHash": "sha256-cLbLPTL1CDmETVh4p0nQtvoF+FSEjsnJTFpTxhXywhQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2f3367769a93b226c467551315e9e270c3f78b15",
"rev": "652fda4ca6dafeb090943422c34ae9145787af37",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1709150264,
"narHash": "sha256-HofykKuisObPUfj0E9CJVfaMhawXkYx3G8UIFR/XQ38=",
"lastModified": 1709569716,
"narHash": "sha256-iOR44RU4jQ+YPGrn+uQeYAp7Xo7Z/+gT+wXJoGxxLTY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9099616b93301d5cf84274b184a3a5ec69e94e08",
"rev": "617579a787259b9a6419492eaac670a5f7663917",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1709479366,
"narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b8697e57f10292a6165a20f03d2f42920dfaf973",
"type": "github"
},
"original": {
@ -39,7 +56,8 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
}
},

View File

@ -2,34 +2,45 @@
description = "Torjus nixos config flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
# nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
url = "github:nix-community/home-manager?ref=release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }@inputs:
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@inputs:
let
system = "x86_64-linux";
user = "torjus";
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
};
in
{
nixosConfigurations = {
prismo = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
specialArgs = { inherit inputs self user; };
modules = [ ./hosts/prismo ];
};
magicman = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
specialArgs = { inherit inputs self user; };
modules = [ ./hosts/magicman ];
};
gunter = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit system;
specialArgs = { inherit inputs self user; };
modules = [ ./hosts/gunter ];
modules = [
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
./hosts/gunter
];
};
};
};

View File

@ -9,9 +9,16 @@
./editor/neovim
./programs/firefox
./programs/tmux
./programs/dunst
./programs/kitty
./programs/rofi
./programs/obs-studio
./scripts
./zsh
./packages
./hyprland
./ssh
./services/backup-home.nix
];
firefox.enable = true;
tmux.enable = true;

View File

@ -14,8 +14,14 @@
lsp-zero-nvim
vim-floaterm
luasnip
cmp_luasnip
lualine-nvim
vim-sleuth
copilot-lua
copilot-cmp
cmp-cmdline
cmp-buffer
catppuccin-nvim
(nvim-treesitter.withPlugins (p: [
p.tree-sitter-yaml
p.tree-sitter-nix
@ -43,8 +49,10 @@
gopls
nodePackages.pyright
nodePackages.typescript-language-server
nodePackages.typescript
nil
yaml-language-server
lua-language-server
];
home.sessionVariables.EDITOR = "nvim";
}

View File

@ -3,11 +3,26 @@
-- LSP stuff
local lsp_zero = require('lsp-zero')
lsp_zero.on_attach(function(client, bufnr)
lsp_zero.default_keymaps({buffer = bufnr})
lsp_zero.on_attach(function(_, bufnr)
lsp_zero.default_keymaps({ buffer = bufnr })
end)
require('lspconfig').gopls.setup({
lsp_zero.format_on_save({
format_opts = {
async = false,
timeout_ms = 10000,
},
servers = {
['gopls'] = { 'go' },
['nil_ls'] = { 'nix' },
['lua_ls'] = { 'lua' },
['tsserver'] = { 'typescript', 'javascript' },
},
})
local lspconfig = require('lspconfig')
lspconfig.gopls.setup({
settings = {
gopls = {
analyses = {
@ -19,25 +34,69 @@ require('lspconfig').gopls.setup({
}
})
-- Cmp
local cmp = require('cmp')
local cmp_action = lsp_zero.cmp_action()
cmp.setup({
mapping = cmp.mapping.preset.insert({
-- Enter to confirm completion
['<CR>'] = cmp.mapping.confirm({select = false}),
-- Ctrl+Space to open completion menu
['<C-Space>'] = cmp.mapping.complete(),
-- Move between snippet placeholders
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
-- Scroll in completion docs
['<C-k>'] = cmp.mapping.scroll_docs(-4),
['<C-j>'] = cmp.mapping.scroll_docs(4),
})
lspconfig.nil_ls.setup({
autostart = true,
settings = {
['nil'] = {
formatting = {
command = { "nixpkgs-fmt" },
},
},
},
})
lspconfig.lua_ls.setup({
on_init = function(client)
local path = client.workspace_folders[1].name
if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then
return
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT'
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- Depending on the usage, you might want to add additional paths here.
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
}
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
-- library = vim.api.nvim_get_runtime_file("", true)
}
})
end,
settings = {
Lua = {
format = {
enable = true,
defaultConfig = {
indent_style = "space",
indent_size = "2",
}
}
}
}
})
lspconfig.tsserver.setup({
init_options = {
plugins = {
},
},
filetypes = {
"typescript",
"javascript",
},
})
-- Telescope
require('telescope').setup({
extensions = {
@ -55,7 +114,7 @@ require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true},
indent = { enable = true },
incremental_selection = {
enable = true,
@ -110,8 +169,51 @@ require('lualine').setup({
}
}
},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_y = { 'progress' },
lualine_z = { 'location' }
}
})
-- Copilot
require('copilot').setup({
suggestions = { enabled = false },
panel = { enabled = false },
})
require('copilot_cmp').setup()
-- Cmp
local cmp = require('cmp')
local cmp_action = lsp_zero.cmp_action()
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
-- Enter to confirm completion
['<CR>'] = cmp.mapping.confirm({ select = false }),
-- Ctrl+Space to open completion menu
['<C-Space>'] = cmp.mapping.complete(),
-- Move between snippet placeholders
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
-- Scroll in completion docs
['<C-k>'] = cmp.mapping.scroll_docs(-4),
['<C-j>'] = cmp.mapping.scroll_docs(4),
}),
sources = cmp.config.sources({
}, {
{ name = "copilot", group_index = 2 },
{ name = "luasnip" },
{ name = "buffer" },
})
})
-- Colorscheme
require('catppuccin').setup({
})
vim.cmd.colorscheme "catppuccin"

11
home/hyprland/cursor.nix Normal file
View File

@ -0,0 +1,11 @@
{ pkgs, ... }: {
home.pointerCursor = {
gtk.enable = true;
# x11.enable = true;
package = pkgs.catppuccin-cursors.macchiatoLavender;
name = "Catppuccin-Macchiato-Lavender-Cursors";
size = 32;
};
gtk.enable = true;
}

View File

@ -1 +1 @@
{ imports = [ ./hyprland.nix ./waybar.nix ./xdg.nix ]; }
{ imports = [ ./hyprland.nix ./waybar ./xdg.nix ./cursor.nix ]; }

View File

@ -1,20 +1,60 @@
{ inputs, pkgs, lib, config, ... }: {
options.hyprland.enable = lib.mkEnableOption "Hyprland";
config = {
home.packages = with pkgs; [ swww wl-clipboard cliphist hyprpaper hyprlock ];
home.packages = with pkgs; [
cliphist
dunst
# hyprlock
hyprpaper
rofi-wayland
slurp
swww
waybar
wl-clipboard
catppuccin-cursors.macchiatoLavender
bibata-cursors
# For potentially fixing some issues
libsForQt5.qt5.qtwayland
libsForQt5.qt5ct
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
settings = {
"$mainMod" = "SUPER";
"$term" = "alacritty";
"$shiftMainMod" = "SUPER_SHIFT";
"$term" = "kitty";
monitor = [ "eDP-1,1920x1080@60,0x0,1" ];
# monitors
"$mon_top" = "desc:BNQ G2420HDBL T2B04424SL000";
"$mon_left" = "desc:Samsung Electric Company LS27A600U HNMT502389";
"$mon_center" = "desc:Acer Technologies XB271HU #ASPVEKfgZ8Dd";
"$mon_right" = "desc:Samsung Electric Company LS27A600U HNMT502390";
monitor = [
# "$mon_top,1920x1080@60,2560x0,1" # top T2B04424SL000
"DP-6,1920x1080@60,2560x0,1" # top T2B04424SL000 60
# "$mon_left,2560x1440@75,0x1080,1" # left
"DP-8,2560x1440@75,0x1080,1" # left 75hz
# "$mon_center,2560x1440@120,2560x1080,1" # main #ASPVEKfgZ8Dd
"DP-5,2560x1440@120,2560x1080,1" # main #ASPVEKfgZ8Dd 120hz
# "$mon_right,2560x1440@75,5120x1080,1" # right
"DP-7,2560x1440@75,5120x1080,1" # right 75hz
];
input = {
kb_layout = "no";
follow_mouse = 1;
};
env = [
"LIBVA_DRIVER_NAME,nvidia"
"XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
# "__GLX_VENDOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1"
];
decoration = {
rounding = 0;
drop_shadow = true;
@ -55,14 +95,37 @@
misc.force_default_wallpaper = -1;
windowrulev2 = [
"opacity 0.95 override 0.5 override,class:^(Alacritty)$"
"opacity 0.95 override 0.7 override,class:^(Alacritty)$"
"opacity 0.95 override 0.7 override,class:^(kitty)$"
];
workspace = [
"name:mumble, monitor:$mon_top, persistent:true, default:true"
"name:left, monitor:$mon_left, persistent:true, default:true"
"name:right, monitor:$mon_right, persistent:true, default:true"
"name:main 1, monitor:$mon_center, persistent:true, default:true"
"name:main 2, monitor:$mon_center, persistent:true, default:true"
];
bindm = [
"ALT,mouse:272,movewindow"
];
bindr = [
# mumble ptt release
# ",code:202,exec,mumble rpc stoptalking"
# ",code:202,exec,pamixer --source 63 -m"
",code:202,exec,pamixer --default-source -m"
];
bind = [
# term
"$mainMod,Return,exec,$term"
# rofi
"$mainMod,D,exec,rofi -show drun"
"$mainMod,D,exec,rofi-launcher"
"$mainMod,P,exec,rofi-rbw"
# hyprland
"$mainMod,Q,killactive,"
"CTRLALT,Delete,exit,"
@ -80,16 +143,29 @@
"$mainMod,l,movewindow,r"
"$mainMod,k,movewindow,u"
"$mainMod,j,movewindow,d"
] ++ (builtins.concatLists (builtins.genList
(x:
let
ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10));
in
[
"$mainMod, ${ws}, workspace, ${toString (x + 1)}"
"ALT, ${ws}, workspace, ${toString (x + 1)}"
]) 10));
exec-once = [ "waybar & hyprpaper" ];
# Force opacity
"$shiftMainMod,o,exec, hl-no-opacity"
# mumble ptt click
# ",code:202,exec,mumble rpc starttalking"
",code:202,exec,pamixer --default-source -u"
# worspace switching
"$mainMod,1,workspace,name:main 1"
"$mainMod,2,workspace,name:main 2"
"$mainMod,3,workspace,3"
"$mainMod,4,workspace,4"
"$mainMod,5,workspace,5"
"$mainMod,6,workspace,6"
];
exec-once = [
"waybar"
"hyprpaper & sleep 2 && randomwp"
"easyeffects --gapplication-service"
# "dunst"
];
};
};
};

View File

@ -1,3 +1 @@
preload = ~/pics/wallpapers/1.jpg
wallpaper = eDP-1,~/pics/wallpapers/1.jpg
splash = false

View File

@ -0,0 +1,195 @@
{ pkgs, lib, ... }: {
xdg.configFile."waybar/macchiato.css" = {
source = pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "waybar";
rev = "f74ab1eecf2dcaf22569b396eed53b2b2fbe8aff";
sha256 = "WLJMA2X20E5PCPg0ZPtSop0bfmu+pLImP9t8A8V4QK8=";
} + "/themes/machiatto.css";
};
programs.waybar = {
enable = true;
systemd = {
enable = false; # disable it,autostart it in hyprland conf
target = "graphical-session.target";
};
style = ''
* {
font-family: "FiraCodeNerdFont-Regular";
font-size: 14px;
font-weight: bold;
border-radius: 0px;
transition-property: background-color;
transition-duration: 0.5s;
}
@keyframes blink_red {
to {
background-color: rgb(242, 143, 173);
color: rgb(26, 24, 38);
}
}
.warning,
.critical,
.urgent {
animation-name: blink_red;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
window#waybar {
background-color: transparent;
}
window > box {
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
border-bottom: 2px solid @color1;
background-color: @background;
}
#workspaces {
padding-left: 0px;
padding-right: 4px;
}
#workspaces button {
padding-top: 5px;
padding-bottom: 5px;
padding-left: 6px;
padding-right: 6px;
color: @color1;
}
#workspaces button.active {
background-color: @color1;
color: rgb(26, 24, 38);
}
#workspaces button.urgent {
color: rgb(26, 24, 38);
}
#workspaces button:hover {
background-color: #b38dac;
color: rgb(26, 24, 38);
}
tooltip {
background: #3b4253;
}
tooltip label {
color: #e4e8ef;
}
#custom-launcher {
font-size: 20px;
padding-left: 8px;
padding-right: 6px;
color: #7ebae4;
}
#mode,
#clock,
#memory,
#temperature,
#cpu,
#mpd,
#custom-wall,
#temperature,
#backlight,
#pulseaudio,
#network,
#battery,
#custom-powermenu,
#custom-cava-internal {
padding-left: 10px;
padding-right: 10px;
color: @color1;
}
#network.disconnected {
color: #cccccc;
}
#battery.charging,
#battery.full,
#battery.discharging {
color: #cf876f;
}
#battery.critical:not(.charging) {
color: #d6dce7;
}
#custom-powermenu {
color: #bd6069;
}
#tray {
padding-right: 8px;
padding-left: 10px;
}
#tray menu {
background: #3b4252;
color: #dee2ea;
}
#mpd.paused {
color: rgb(192, 202, 245);
font-style: italic;
}
#mpd.stopped {
background: transparent;
}
#mpd {
color: #e4e8ef;
}
#custom-cava-internal {
font-family: "Hack Nerd Font";
}
'';
settings = [{
"layer" = "top";
"position" = "top";
modules-left = [ "custom/launcher" "hyprland/workspaces" ];
modules-center = [ "clock" ];
modules-right =
[ "pulseaudio" "pulseaudio#microphone" "memory" "cpu" "tray" ];
"custom/launcher" = {
"format" = " ";
"on-click" = "pkill rofi || ~/.config/rofi/launcher.sh";
"tooltip" = false;
};
"hyprland/workspaces" = {
"format" = "{name}";
"on-click" = "activate";
"on-scroll-up" = "hyprctl dispatch workspace e+1";
"on-scroll-down" = "hyprctl dispatch workspace e-1";
};
"pulseaudio" = {
"scroll-step" = 5;
"format" = "{icon} {volume}%";
"format-muted" = "";
"format-icons" = { "default" = [ "" "" "" ]; };
"on-click" = "pamixer -t";
};
"pulseaudio#microphone" = {
"format" = "{format_source}";
"format-source" = " {volume}%";
"format-source-muted" = "";
"on-click" = "pamixer --default-source -t";
"on-scroll-up" = "pamixer --default-source -i 5";
"on-scroll-down" = "pamixer --default-source -d 5";
"scroll-step" = 5;
"on-click-right" = "pavucontrol";
};
"clock" = {
"interval" = 1;
"format" = "{:%H:%M %A %b %d}";
"tooltip" = true;
};
"memory" = {
"interval" = 3;
"format" = " {percentage}%";
"states" = { "warning" = 85; };
};
"cpu" = {
"interval" = 3;
"format" = " {usage}%";
};
"tray" = {
"icon-size" = 15;
"spacing" = 6;
};
}];
};
}

View File

@ -7,7 +7,7 @@
};
style = ''
* {
font-family: "Fira Code", "Font Awesome 6 Free";
font-family: "FiraCodeNerdFont-Regular";
font-size: 14px;
font-weight: bold;
border-radius: 0px;
@ -164,7 +164,7 @@
};
"clock" = {
"interval" = 1;
"format" = "{:%I:%M %p %A %b %d}";
"format" = "{:%H:%M %A %b %d}";
"tooltip" = true;
};
"memory" = {

32
home/i3/default.nix Normal file
View File

@ -0,0 +1,32 @@
{ config, lib, pkgs, ... }:
let
mod = "Mod4";
in
{
xsession.windowManager.i3 = {
enable = true;
config = {
modifier = mod;
keybindings = lib.mkOptionDefault {
"${mod}+Enter" = "exec kitty";
# Focus
"${mod}+j" = "focus left";
"${mod}+k" = "focus down";
"${mod}+l" = "focus up";
"${mod}+semicolon" = "focus right";
# Move
"${mod}+Shift+j" = "move left";
"${mod}+Shift+k" = "move down";
"${mod}+Shift+l" = "move up";
"${mod}+Shift+semicolon" = "move right";
# My multi monitor setup
"${mod}+m" = "move workspace to output DP-2";
"${mod}+Shift+m" = "move workspace to output DP-5";
};
};
};
}

View File

@ -3,7 +3,7 @@
# Generic tools
age
alacritty
btop
unstable.btop
bzip2
croc
easyeffects
@ -11,20 +11,36 @@
ffmpeg
file
go-task
glib
jq
kitty
kubectl
ncdu
nwg-look
mumble
mpv
pamixer
pinentry
pre-commit
pulseaudio
pulsemixer
rbw
restic
ripgrep
rofi-rbw-wayland
spotify
spicetify-cli
sshfs
talosctl
# steam
# steam-run
# steamcmd
# gamescope
tokei
unzip
yt-dlp
unstable.zoom-us
# Editors
vscode
@ -34,6 +50,11 @@
delve
gopls
# js/ts
nodejs
nodePackages.pnpm
typescript
# Py stuff
python3
poetry

View File

@ -0,0 +1,76 @@
{ config, lib, pkgs, ... }:
{
services.dunst = {
enable = true;
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
settings = {
global = {
rounded = "yes";
origin = "top-right";
monitor = "3";
alignment = "left";
vertical_alignment = "center";
width = "400";
height = "400";
scale = 0;
gap_size = 0;
progress_bar = true;
transparency = 0;
text_icon_padding = 0;
separator_color = "frame";
sort = "yes";
idle_threshold = 120;
line_height = 0;
markup = "full";
show_age_threshold = 60;
ellipsize = "middle";
ignore_newline = "no";
stack_duplicates = true;
sticky_history = "yes";
history_length = 20;
always_run_script = true;
corner_radius = 10;
# follow = "mouse";
font = "Source Sans Pro 10";
format = "<b>%s</b>\\n%b"; #format = "<span foreground='#f3f4f5'><b>%s %p</b></span>\n%b"
frame_color = "#232323";
frame_width = 1;
offset = "15x15";
horizontal_padding = 10;
icon_position = "left";
indicate_hidden = "yes";
min_icon_size = 0;
max_icon_size = 64;
mouse_left_click = "do_action, close_current";
mouse_middle_click = "close_current";
mouse_right_click = "close_all";
padding = 10;
plain_text = "no";
separator_height = 2;
show_indicators = "yes";
shrink = "no";
word_wrap = "yes";
browser = "/usr/bin/env firefox -new-tab";
};
fullscreen_delay_everything = { fullscreen = "delay"; };
urgency_critical = {
background = "#d64e4e";
foreground = "#f0e0e0";
};
urgency_low = {
background = "#232323";
foreground = "#2596be";
};
urgency_normal = {
background = "#1e1e2a";
foreground = "#2596be";
};
};
};
}

View File

@ -0,0 +1,24 @@
{ config, pkgs, ... }: {
xdg.configFile."kitty/kitty.conf" = {
source = config.lib.file.mkOutOfStoreSymlink ./. + "/kitty.conf";
target = "kitty/kitty.conf";
};
xdg.configFile."kitty/themes/macchiato.conf" = {
source = pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "kitty";
rev = "d7d61716a83cd135344cbb353af9d197c5d7cec1";
sha256 = "mRFa+40fuJCUrR1o4zMi7AlgjRtFmii4fNsQyD8hIjM=";
} + "/themes/macchiato.conf";
};
xdg.configFile."kitty/themes/latte.conf" = {
source = pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "kitty";
rev = "d7d61716a83cd135344cbb353af9d197c5d7cec1";
sha256 = "mRFa+40fuJCUrR1o4zMi7AlgjRtFmii4fNsQyD8hIjM=";
} + "/themes/latte.conf";
};
}

View File

@ -0,0 +1,23 @@
# shell
shell .
# mute bell
enable_audio_bell no
# Remove close window confirm
confirm_os_window_close 0
# Font config
font_family Fira Code
bold_font Fira Code
italic_font Fira Code
bold_italic_font Fira Code
# Emoji font
# Symbols Nerd Font Mono
font_size 14.0
# Window padding
window_padding_width 10
include themes/macchiato.conf

View File

@ -0,0 +1,8 @@
{ pkgs, ... }: {
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-backgroundremoval
];
};
}

View File

@ -0,0 +1,17 @@
configuration{
modi: "run,drun,window";
icon-theme: "Oranchelo";
show-icons: true;
terminal: "alacritty";
drun-display-format: "{icon} {name}";
location: 0;
disable-history: false;
hide-scrollbar: true;
display-drun: "  Apps ";
display-run: "  Run ";
display-window: " 﩯 Window";
display-Network: " 󰤨 Network";
sidebar-mode: true;
}
@theme "latte"

View File

@ -0,0 +1,24 @@
{ config, pkgs, ... }: {
xdg.configFile."rofi/config.rasi" = {
source = ./config.rasi;
};
xdg.configFile."rofi/macchiato.rasi" = {
source = pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "rofi";
rev = "5350da41a11814f950c3354f090b90d4674a95ce";
sha256 = "DNorfyl3C4RBclF2KDgwvQQwixpTwSRu7fIvihPN8JY=";
} + "/basic/.local/share/rofi/themes/catppuccin-macchiato.rasi";
};
xdg.configFile."rofi/latte.rasi" = {
source = pkgs.fetchFromGitHub
{
owner = "catppuccin";
repo = "rofi";
rev = "5350da41a11814f950c3354f090b90d4674a95ce";
sha256 = "DNorfyl3C4RBclF2KDgwvQQwixpTwSRu7fIvihPN8JY=";
} + "/basic/.local/share/rofi/themes/catppuccin-latte.rasi";
};
}

14
home/scripts/default.nix Normal file
View File

@ -0,0 +1,14 @@
{ pkgs, config, ... }: {
home.file.".local/bin/hl-no-opacity" = {
source = ./hl-no-opacity.sh;
executable = true;
};
home.file.".local/bin/rofi-launcher" = {
source = ./rofi-launcher.sh;
executable = true;
};
home.file.".local/bin/randomwp" = {
source = ./randomwp.sh;
executable = true;
};
}

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
addr=$(hyprctl activewindow -j|jq -r .address)
hyprctl setprop "address:$addr" alpha 1 lock
hyprctl setprop "address:$addr" alphainactive 1 lock

31
home/scripts/randomwp.sh Normal file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -eo pipefail
if [ -z "${WALLPAPER_DIR}" ]; then
WALLPAPER_DIR="${HOME}/wallpapers"
fi
if ! [ -d "$WALLPAPER_DIR" ]; then
echo "Wallpaper dir is not a directory"
exit 1
fi
wallpaper_path=$(find "$WALLPAPER_DIR" -mindepth 1 | sort -R | tail -n 1)
if [ -z "$wallpaper_path" ]; then
echo "Unable to find wallpaper"
exit 1
fi
if ! command -v hyprpaper &> /dev/null; then
echo "Could not find hyprpaper command"
exit 1
fi
echo "setting $wallpaper_path as wallpaper"
hyprctl hyprpaper unload all
hyprctl hyprpaper preload "$wallpaper_path"
for monitor in $(hyprctl monitors | grep 'Monitor' | awk '{ print $2 }'); do
hyprctl hyprpaper wallpaper "$monitor,$wallpaper_path"
done

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
rofi \
-show drun \
-modi run,drun,ssh \
-scroll-method 0 \
-drun-match-fields all \
-drun-display-format "{name}" \
-terminal kitty

View File

@ -0,0 +1,79 @@
{ pkgs, ... }:
let
# Backup home script
backup-home = pkgs.writeShellScriptBin "backup-home.sh"
''
export RESTIC_PASSWORD="gunter.home.2rjus.net"
export RESTIC_REPOSITORY="rest:http://10.69.12.52:8000/gunter.home.2rjus.net"
# Send start notification
${pkgs.libnotify}/bin/notify-send -e -t 3000 "Backup started" "Backup of /home/torjus started"
retval=$?
if [ $retval -ne 0 ]; then
echo "Failed to send notification"
exit 1
fi
# Do the backup
SECONDS=0
${pkgs.restic}/bin/restic backup /home/torjus \
--exclude '/home/torjus/.cache' \
--exclude '/home/torjus/.local/share/Steam' \
--exclude '/home/torjus/git/nixpkgs'
retval=$?
if [ $retval -ne 0 ]; then
notify-send -u critical "Backup failed" "Backup of /home/torjus failed"
exit 1
fi
# Remove old snapshots and prune
${pkgs.restic}/bin/restic forget -d 7 -w 4 -m 6 --keep-within 1d --prune
# Gather statistics
stats=$(${pkgs.restic}/bin/restic stats --json)
stats_raw=$(${pkgs.restic}/bin/restic stats --mode=raw-data --json)
raw_size=$(${pkgs.jq}/bin/jq -r '.total_size' <<< $stats_raw \
| ${pkgs.coreutils}/bin/numfmt --to=iec --suffix=B --format="%.2f")
total_size=$(${pkgs.jq}/bin/jq -r '.total_size' <<< $stats \
| ${pkgs.coreutils}/bin/numfmt --to=iec --suffix=B --format="%.2f")
total_files=$(${pkgs.jq}/bin/jq -r '.total_file_count' <<< $stats \
| ${pkgs.coreutils}/bin/numfmt --to=iec)
total_snapshots=$(${pkgs.jq}/bin/jq -r '.snapshots_count' <<< $stats)
message="$total_files files\n$total_snapshots snapshots\n$raw_size ($total_size)"
# Send completion notification
${pkgs.libnotify}/bin/notify-send -i checkmark -e -t 10000 \
"Backup of /home/torjus completed in ''${SECONDS}s" "$message"
retval=$?
if [ $retval -ne 0 ]; then
echo "Failed to send notification"
exit 1
fi
'';
in
{
systemd.user.services.backup-home = {
Unit = {
Description = "Backup home directory";
After = [ "network.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${backup-home}/bin/backup-home.sh";
};
};
systemd.user.timers.backup-home = {
Unit = {
Description = "Backup home directory";
After = [ "network.target" ];
};
Timer = {
OnCalendar = "*-*-* *:00:00";
Persistent = true;
};
Install = {
WantedBy = [ "timers.target" ];
};
};
}

1
home/ssh/default.nix Normal file
View File

@ -0,0 +1 @@
{ imports = [ ./gunter.nix ]; }

15
home/ssh/gunter.nix Normal file
View File

@ -0,0 +1,15 @@
{ pkgs, ... }: {
programs.ssh = {
enable = true;
controlMaster = "auto";
matchBlocks."bmo.uio.no" = {
setEnv = {
# TERM = "xterm-256color";
};
hostname = "bmo.uio.no";
forwardAgent = false;
proxyJump = "torjus@rlogin.uio.no";
};
};
}

View File

@ -7,7 +7,7 @@
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = {
nrebuild = "sudo nixos-rebuild switch --flake /home/${user}/nixos#prismo";
nrebuild = "sudo nixos-rebuild switch --flake /home/${user}/nixos";
};
initExtra = ''
bindkey -v

View File

@ -9,9 +9,20 @@
"splash"
"rd.systemd.show_status=false"
];
boot.loader.systemd-boot = { enable = true; };
boot.loader.systemd-boot = {
enable = true;
configurationLimit = 10;
};
boot.supportedFilesystems = [ "nfs" ];
boot.loader.efi = { canTouchEfiVariables = true; };
boot.extraModprobeConfig = ''
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
'';
# Networking stuff
networking.hostName = "gunter"; # Define your hostname.
networking.networkmanager.enable = true;
@ -20,18 +31,45 @@
time.timeZone = "Europe/Oslo";
# Enable opengl
# hardware.opengl = {
# enable = true;
# extraPackages = with pkgs; [
# ];
# };
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiVdpau
nvidia-vaapi-driver
];
};
# Nvidia stuff
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Setup hyprland
# nixpkgs.overlays = [
# (self: super: {
# hyprland = super.hyprland.override {
# debug = true;
# };
# })
# ];
services.xserver.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.displayManager.gdm.wayland = true;
services.xserver.displayManager.lightdm.enable = false;
services.xserver.displayManager.startx.enable = true;
services.xserver.windowManager.i3.enable = true;
programs.hyprland = {
enable = true;
xwayland.enable = true;
portalPackage = pkgs.xdg-desktop-portal-hyprland;
portalPackage = pkgs.unstable.xdg-desktop-portal-hyprland;
};
# Setup common XDG env vars
@ -49,7 +87,7 @@
enable = true;
xdgOpenUsePortal = true;
extraPortals = (with pkgs; [
xdg-desktop-portal-hyprland
# unstable.xdg-desktop-portal-hyprland
xdg-desktop-portal-gtk
]);
};
@ -60,10 +98,20 @@
nixpkgs.config.allowUnfree = true;
# Install system-wide packages
environment.systemPackages = with pkgs; [
vim
wget
curl
git
libnotify
usbutils
vim
wget
v4l-utils
# X shit
# xorg.xorgserver
# xorg.xinit
# xorg.xf86inputevdev
# xorg.xf86inputlibinput
# xorg.xinit
];
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,

View File

@ -2,6 +2,8 @@
imports = [
./configuration.nix
./hardware-configuration.nix
./steamuser.nix
./nfs.nix
../../system
../../home
];

View File

@ -0,0 +1,46 @@
# 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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "v4l2loopback" ];
boot.extraModulePackages = with config.boot.kernelPackages; [
v4l2loopback
];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/a7d4b697-fffa-4bcb-9dd7-cbbd6121a50c";
fsType = "xfs";
};
boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/be82b184-3cc7-483b-9069-f7797f51c853";
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/DC0C-AAB3";
fsType = "vfat";
};
swapDevices =
[{ device = "/dev/disk/by-uuid/2284e9c6-c168-4d4f-ba6a-d270f1ae245d"; }];
# 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.enp12s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp13s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

22
hosts/gunter/nfs.nix Normal file
View File

@ -0,0 +1,22 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
nfs-utils
];
services.rpcbind.enable = true;
systemd.mounts = [{
type = "nfs";
mountConfig = {
Options = "rw,soft,noatime";
};
what = "nas.home.2rjus.net:/mnt/hdd-pool/media";
where = "/mnt/nas/media";
}];
systemd.automounts = [{
wantedBy = [ "multi-user.target" ];
automountConfig = {
TimeoutIdleSec = "5min";
};
where = "/mnt/nas/media";
}];
}

View File

@ -0,0 +1,22 @@
{ pkgs, ... }: {
environment.shells = with pkgs; [ zsh ];
services.xserver.desktopManager.xfce.enable = true;
programs.steam.enable = true;
services.flatpak.enable = true;
users.users.steam = {
isNormalUser = true;
initialPassword = "steam";
home = "/home/steam";
description = "Steam user";
shell = pkgs.zsh;
# Install some user packages
packages = with pkgs; [
firefox
mumble
easyeffects
];
};
}

View File

@ -3,10 +3,12 @@
fonts.packages = with pkgs; [
fira-code
fira-code-symbols
nerdfonts
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-monochrome-emoji
source-sans-pro
twemoji-color-font
font-awesome
];

View File

@ -14,13 +14,6 @@
extraGroups = [ "wheel" "networkmanager" ];
# Install some user packages
packages = with pkgs; [
# Hyprland stuff
rofi-wayland
swaylock
waybar
dunst
slurp
wpaperd
];
};
}