This commit is contained in:
Martin Benonisen 2024-03-18 12:58:34 +01:00
parent 3ed1ee7954
commit 68dfc234c6
Signed by: mbeno
GPG Key ID: 025254EFB372A723
31 changed files with 956 additions and 227 deletions

View File

@ -1,227 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
let
unstable = import <unstable> {config = { allowUnfree = true; };};
in
{
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
hardware.ckb-next.enable = true;
networking.firewall.enable = false;
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"]; # or "nvidiaLegacy470 etc.
security.polkit.enable = true;
environment.pathsToLink = [ "/libexec" ];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Oslo";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Enable the X11 windowing system.
services.xserver.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
programs.zsh.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
users.defaultUserShell = pkgs.zsh;
# Define a user account. Don't forget to set a password with passwd.
users.users.mbeno = {
shell = pkgs.zsh;
isNormalUser = true;
description = "Martin";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [
firefox
alacritty
mumble
zoom
mattermost-desktop
# thunderbird
];
};
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
security.sudo.extraRules= [
{ users = [ "mbeno" ];
commands = [
{ command = "ALL" ;
options= [ "NOPASSWD" ]; # "SETENV" # Adding the following could be a good idea
}
];
}
];
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
services.xserver = {
desktopManager = {
xterm.enable = false;
};
displayManager = {
defaultSession = "none+i3";
autoLogin.enable = true;
autoLogin.user = "mbeno";
};
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu #application launcher most people use
i3status # gives you the default i3 status bar
i3lock #default i3 screen locker
i3blocks #if you are planning on using i3blocks over i3status
polybar
rofi
picom
nitrogen
];
};
};
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
steam-run
xdg-utils
xdg-desktop-portal
xdg-desktop-portal-gtk
unstable.zoom-us
neovim
git
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
];
virtualisation.docker.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

51
flake.nix Normal file
View File

@ -0,0 +1,51 @@
{
description = "Benny nixos config flake";
inputs = {
# 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?ref=release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix.url = "github:Mic92/sops-nix";
};
outputs =
{ self
, nixpkgs
, nixpkgs-unstable
, sops-nix
, notlistener
, ghettoptt
, ...
}@inputs:
let
system = "x86_64-linux";
user = "mbeno";
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
};
in
{
nixosConfigurations = {
zedd = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs self user sops-nix; };
modules = [
({ config, pkgs, ... }: {
nixpkgs.overlays = [
overlay-unstable
];
})
./hosts/mbeno
sops-nix.nixosModules.sops
];
};
};
};
}

View File

@ -0,0 +1,32 @@
{ config, pkgs, ... }:
let
unstable = import <unstable> { config = { allowUnfree = true; }; };
in
{
# Enable OpenGL
# Load nvidia driver for Xorg and Wayland
environment.pathsToLink = [ "/libexec" ];
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos"; # Define your hostname.
networking.networkmanager.enable = true;
time.timeZone = "Europe/Oslo";
i18n.defaultLocale = "en_US.UTF-8";
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
virtualisation.docker.enable = true;
system.stateVersion = "23.11"; # Did you read the comment?
}

8
hosts/zedd/default.nix Normal file
View File

@ -0,0 +1,8 @@
{ inputs, self, pks, ... }: {
imports = [
./configuration.nix
./hardware-configuration.nix
../../system
../../user
];
}

1
system/default.nix Normal file
View File

@ -0,0 +1 @@
{ imports = [ ./users ./services ./hardware ./fonts ./security ./programs ] }

15
system/fonts.nix Normal file
View File

@ -0,0 +1,15 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [ twemoji-color-font ];
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
];
}

18
system/hardware.nix Normal file
View File

@ -0,0 +1,18 @@
{ config, pkgs, ... }:
{
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
hardware.ckb-next.enable = true;
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
hardware.pulseaudio.enable = false;
}

45
system/programs.nix Normal file
View File

@ -0,0 +1,45 @@
{ config, pkgs, ... }: {
programs.zsh.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
};
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "curses";
enableSSHSupport = true;
};
environment.systemPackages = with pkgs; [
steam-run
xdg-utils
xdg-desktop-portal
xdg-desktop-portal-gtk
unstable.zoom-us
neovim
git
gnupg
pinentry-rofi
pinentry
rofi-rbw-x11
rbw
nil
nixpkgs-fmt
];
systemd = {
user.services.polkit-gnome-authentication-agent-1 = {
description = "polkit-gnome-authentication-agent-1";
wantedBy = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";
Restart = "on-failure";
RestartSec = 1;
TimeoutStopSec = 10;
};
};
};
}

7
system/security.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs, ... }: {
# Enable sudo
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
}

45
system/services.nix Normal file
View File

@ -0,0 +1,45 @@
{ config, pkgs, ... }: {
sound.enable = true;
security.rtkit.enable = true;
networking.firewall.enable = false;
security.polkit.enable = true;
services = {
xserver = {
enable = true;
layout = "us";
xkbVariant = "";
desktopManager = {
xterm.enable = false;
};
videoDrivers = [ "nvidia" ];
displayManager = {
defaultSession = "none+i3";
autoLogin.enable = true;
autoLogin.user = "mbeno";
};
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu #application launcher most people use
i3status # gives you the default i3 status bar
i3lock #default i3 screen locker
i3blocks #if you are planning on using i3blocks over i3status
polybar
rofi
picom
nitrogen
];
};
};
};
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
services.pcscd.enable = true;
services.dbus.packages = [ pkgs.gcr ];
}

29
system/users.nix Normal file
View File

@ -0,0 +1,29 @@
{ config, pkgs, ... }: {
users.defaultUserShell = pkgs.zsh;
users.users.mbeno = {
shell = pkgs.zsh;
isNormalUser = true;
description = "Martin";
extraGroups = [ "networkmanager" "wheel" "docker" ];
packages = with pkgs; [
firefox
alacritty
mumble
zoom
mattermost-desktop
# thunderbird
];
};
security.sudo.extraRules = [
{
users = [ "mbeno" ];
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ]; # "SETENV" # Adding the following could be a good idea
}
];
}
];
}

35
user/default.nix Normal file
View File

@ -0,0 +1,35 @@
{ pkgs, inputs, user, ... }: {
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit pkgs inputs user; };
users.${user} = { pkgs, ... }: {
imports = [
inputs.sops-nix.homeManagerModules.sops
./sops
./programs/neovim
./programs/firefox
./programs/tmux
./programs/dunst
./programs/kitty
./programs/rofi
./programs/obs-studio
./programs/vscode
./scripts
./zsh
./packages
./ssh
];
firefox.enable = true;
tmux.enable = true;
hyprland.enable = true;
home = {
username = "${user}";
homeDirectory = "/home/${user}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
};
};
}

79
user/packages/default.nix Normal file
View File

@ -0,0 +1,79 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
# Generic tools
age
alacritty
unstable.btop
bzip2
croc
easyeffects
fd
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
sops
spotify
spicetify-cli
sshfs
unstable.ventoy
# k8s tools
unstable.talosctl
unstable.k9s
unstable.cilium-cli
unstable.kubernetes-helm
unstable.cmctl
unstable.krew
# steam
# steam-run
# steamcmd
# gamescope
tokei
unzip
yt-dlp
unstable.zoom-us
unstable.vmware-horizon-client
# Editors
# vscode
# Go stuff
go
delve
gopls
# js/ts
nodejs
nodePackages.pnpm
typescript
# Py stuff
(unstable.python312.withPackages (p: with p; [
requests
]))
poetry
ruff
# Rust
rustup
];
}

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,6 @@
{ pkgs, config, lib, inputs, user, ... }: {
options.firefox.enable = lib.mkEnableOption "Firefox";
config =
lib.mkIf config.firefox.enable { programs.firefox = { enable = true; }; };
}

View File

@ -0,0 +1,58 @@
{ pkgs, ... }: {
programs = {
neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
plugins = with pkgs.vimPlugins; [
vim-fugitive
undotree
telescope-nvim
nvim-cmp
cmp-nvim-lsp
nvim-lspconfig
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
p.tree-sitter-go
p.tree-sitter-lua
p.tree-sitter-vim
p.tree-sitter-bash
p.tree-sitter-json
p.tree-sitter-python
]))
];
extraLuaConfig = ''
${builtins.readFile ./options.lua}
${builtins.readFile ./plugins.lua}
${builtins.readFile ./keybinds.lua}
'';
};
};
home.packages = with pkgs; [
# nix stuff
nixpkgs-fmt
statix
# LSPs
gopls
nodePackages.pyright
nodePackages.typescript-language-server
nodePackages.typescript
nil
yaml-language-server
lua-language-server
];
home.sessionVariables.EDITOR = "nvim";
}

View File

@ -0,0 +1,31 @@
-- Keybinds
-- Term
vim.g.floaterm_keymap_toggle = '<leader>ft'
-- Tabs
vim.keymap.set('n', '<leader>n', ':tabnew<CR>',
{ silent = true, desc = '[N]ew tab' })
vim.keymap.set('n', '<leader>p', ':tabnext<CR>',
{ silent = true, desc = '[p]Next tab' })
vim.keymap.set('n', '<leader>P', ':tabprev<CR>',
{ silent = true, desc = '[P]Previous tab' })
-- Telescope
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles,
{ desc = '[?] FInd recently opened files' })
vim.keymap.set('n', '<leader>ff', require('telescope.builtin').find_files,
{ desc = '[F]ind [F]iles' })
vim.keymap.set('n', '<leader>ff', require('telescope.builtin').find_files,
{ desc = '[F]ind [F]iles' })
vim.keymap.set('n', '<leader>fg', require('telescope.builtin').live_grep,
{ desc = '[F]ind by [G]rep' })
-- Tabs
vim.keymap.set('n', '<leader>tt', ':tabnew<cr>')
vim.keymap.set('n', '<leader>tn', ':tabnext<cr>')
vim.keymap.set('n', '<leader>tp', ':tabprevious<cr>')
-- LSP
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition)

View File

@ -0,0 +1,13 @@
-- Options
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.opt.cursorline = true
vim.opt.scrolloff = 15
vim.opt.wrap = true
vim.o.number = true
vim.o.relativenumber = true
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.expandtab = true

View File

@ -0,0 +1,245 @@
-- Plugins
-- LSP stuff
local lsp_zero = require('lsp-zero')
lsp_zero.on_attach(function(_, bufnr)
lsp_zero.default_keymaps({ buffer = bufnr })
end)
lsp_zero.format_on_save({
format_opts = {
async = false,
timeout_ms = 10000,
},
servers = {
['gopls'] = { 'go' },
['nil_ls'] = { 'nix' },
['lua_ls'] = { 'lua' },
['tsserver'] = { 'typescript', 'javascript' },
},
})
-- LSP: go
local lspconfig = require('lspconfig')
lspconfig.gopls.setup({
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
gofumpt = true,
}
}
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
local params = vim.lsp.util.make_range_params()
params.context = { only = { "source.organizeImports" } }
-- buf_request_sync defaults to a 1000ms timeout. Depending on your
-- machine and codebase, you may want longer. Add an additional
-- argument after params if you find that you have to write the file
-- twice for changes to be saved.
-- E.g., vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, 3000)
local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params)
for cid, res in pairs(result or {}) do
for _, r in pairs(res.result or {}) do
if r.edit then
local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16"
vim.lsp.util.apply_workspace_edit(r.edit, enc)
end
end
end
vim.lsp.buf.format({ async = false })
end
})
-- LSP: nix
lspconfig.nil_ls.setup({
autostart = true,
settings = {
['nil'] = {
formatting = {
command = { "nixpkgs-fmt" },
},
},
},
})
-- LSP: lua
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",
}
}
}
}
})
-- LSP: ts/js
lspconfig.tsserver.setup({
init_options = {
plugins = {
},
},
filetypes = {
"typescript",
"javascript",
},
})
-- Telescope
require('telescope').setup({
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
}
},
})
-- Tresitter stuff
require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
}
}
}
}
-- Lualine
require('lualine').setup({
options = {
icons_enabled = false,
component_separators = '|',
disabled_filetypes = {},
always_divide_middle = true,
globalstatus = true,
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = {
{
'filename',
file_status = true,
newfile_status = true,
path = 3,
shorting_target = 30,
symbols = {
modified = '[+]',
readonly = '[-]',
unnamed = '[No name]',
newfile = '[New]'
}
}
},
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 = "nvim_lsp", group_index = 2 },
-- { name = "luasnip" },
-- { name = "buffer" },
})
})
-- Colorscheme
require('catppuccin').setup({
})
vim.cmd.colorscheme "catppuccin"

View File

@ -0,0 +1,23 @@
{ pkgs, ... }:
# let
# obs-backgroundremoval_1_1_10 = (pkgs.obs-studio-plugins.obs-backgroundremoval.overrideAttrs {
# version = "1.1.10";
# src = pkgs.fetchFromGitHub {
# owner = "occ-ai";
# repo = "obs-backgroundremoval";
# rev = "1.1.10";
# hash = "sha256-6OTtmjXS3fiorEPUSjjqrS8u9fVJnnZZoD722W3JQO8=";
# };
# }).override {
# onnxruntime = pkgs.unstable.onnxruntime;
# };
# in
{
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
obs-backgroundremoval
];
#plugins = [ obs-backgroundremoval_1_1_10 ];
};
}

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";
};
}

View File

@ -0,0 +1,13 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.tmux.enable;
in {
options.tmux.enable = mkEnableOption "tmux";
config = mkIf cfg {
programs.tmux = {
enable = true;
prefix = "C-a";
terminal = "screen-256color";
};
};
}

View File

@ -0,0 +1,19 @@
{ pkgs, ... }: {
programs.vscode = {
enable = true;
enableUpdateCheck = true;
enableExtensionUpdateCheck = true;
extensions = with pkgs.vscode-extensions; [
catppuccin.catppuccin-vsc
catppuccin.catppuccin-vsc-icons
golang.go
vscodevim.vim
ms-python.python
ms-vscode-remote.remote-ssh
bbenoist.nix
];
userSettings = {
"window.titleBarStyle" = "custom";
};
};
}

6
user/scripts/default.nix Normal file
View File

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

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 alacritty

6
user/sops/default.nix Normal file
View File

@ -0,0 +1,6 @@
{ user, ... }: {
sops = {
age.keyFile = "/home/${user}/.config/sops/age/keys.txt";
defaultSopsFile = ../../secrets/${user}/secret.yaml;
};
}

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

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

15
user/ssh/zedd.nix Normal file
View File

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

30
user/zsh/default.nix Normal file
View File

@ -0,0 +1,30 @@
{ user, pkgs, ... }: {
home.packages = with pkgs; [ fd ];
programs.zsh = {
enable = true;
autocd = false;
enableAutosuggestions = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = {
nrebuild = "sudo nixos-rebuild switch --flake /home/${user}/nixos";
};
initExtra = ''
bindkey -v
bindkey '^R' history-incremental-search-backward
# Prompt stuff
autoload -Uz promptinit
promptinit
prompt pure
export PATH="''${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
'';
zplug = {
enable = true;
plugins = [
({ name = "plugins/git"; tags = [ "from:oh-my-zsh" ]; })
({ name = "modules/prompt"; tags = [ "from:prezto" ]; })
];
};
};
}