Compare commits

..

No commits in common. "91adefc48ec8202c230be6b0fdbabc556df6cbb9" and "b49e4656f29885a2cb62fffc9fa15046f13a6c5c" have entirely different histories.

11 changed files with 269 additions and 294 deletions

View File

@ -5,7 +5,6 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master"; nixpkgs-master.url = "github:nixos/nixpkgs/master";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-23.05"; url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -34,7 +33,7 @@
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in {
formatter.${system} = pkgs.alejandra; formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
homeConfigurations = { homeConfigurations = {
kristian = home-manager.lib.homeManagerConfiguration { kristian = home-manager.lib.homeManagerConfiguration {
@ -50,7 +49,7 @@
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
zig.overlays.default # Add zig zig.overlays.default # Adds zig
( # https://github.com/nix-community/home-manager/issues/1538#issuecomment-706627100 ( # https://github.com/nix-community/home-manager/issues/1538#issuecomment-706627100
final: prev: { final: prev: {
unstable = import nixpkgs-unstable { unstable = import nixpkgs-unstable {

View File

@ -1,11 +1,8 @@
{...}: { {enable}: {
config.programs.bash = { inherit enable;
enable = true; shellAliases = {
ll = "ls -lh";
shellAliases = { la = "ls -lah";
ll = "ls -lh"; ".." = "cd ..";
la = "ls -lah";
".." = "cd ..";
};
}; };
} }

View File

@ -1,10 +1,14 @@
{ {
config, config,
pkgs,
lib, lib,
options, options,
specialArgs, specialArgs,
modulesPath, modulesPath,
wallpaper,
}: { }: {
nixpkgs.config.allowUnfreePredicate = _: true;
home.stateVersion = "23.05"; home.stateVersion = "23.05";
home.username = "kristian"; home.username = "kristian";
home.homeDirectory = "/home/kristian"; home.homeDirectory = "/home/kristian";
@ -14,23 +18,19 @@
NIXOS_OZONE_WL = 1; NIXOS_OZONE_WL = 1;
}; };
# Keyboard Layout # TODO: Change for Laptop
home.keyboard.layout = "at";
# TODO Change for Laptop
targets.genericLinux.enable = false; # Enable on non-nixos ditros targets.genericLinux.enable = false; # Enable on non-nixos ditros
imports = [ # Keyboard Layout
./bash.nix home.keyboard.layout = "at"; # NOTE: Set by Hyprland config
./direnv.nix
./firefox.nix # Programs (additional programs)
./git.nix home.packages = import ./packages.nix {inherit pkgs;};
./gnome.nix
./nvim # Services
./packages.nix services = {
./thunderbird.nix copyq.enable = true;
./vscode.nix };
];
# Programs # Programs
programs = { programs = {
@ -38,16 +38,29 @@
mpv.enable = true; mpv.enable = true;
obs-studio.enable = true; obs-studio.enable = true;
yt-dlp.enable = true; yt-dlp.enable = true;
};
# Services bash = import ./bash.nix {enable = true;};
services = { vscode = import ./vscode.nix {
copyq.enable = true; enable = true;
inherit pkgs;
};
direnv = import ./direnv.nix {enable = true;};
git = import ./git.nix {enable = true;};
thunderbird = import ./thunderbird.nix {enable = true;};
neovim = import ./nvim {
enable = true;
inherit pkgs;
};
firefox = import ./firefox.nix {
enable = true;
nur = config.nur;
};
}; };
xdg.mimeApps = { xdg.mimeApps = {
enable = true; enable = true;
defaultApplications = { defaultApplications = {
"image/png" = ["org.gnome.eog.desktop"]; "image/png" = ["org.gnome.eog.desktop"];
"image/jpeg" = ["org.gnome.eog.desktop"]; "image/jpeg" = ["org.gnome.eog.desktop"];
@ -55,4 +68,10 @@
"application/pdf" = ["org.gnome.Evince.desktop"]; "application/pdf" = ["org.gnome.Evince.desktop"];
}; };
}; };
# Gnome settings
dconf.settings = import ./gnome.nix {
inherit lib;
inherit wallpaper;
};
} }

View File

@ -1,8 +1,5 @@
{...}: { {enable}: {
config.programs.direnv = { inherit enable;
enable = true; nix-direnv.enable = enable;
enableBashIntegration = true;
nix-direnv.enable = true;
enableBashIntegration = true;
};
} }

View File

@ -1,23 +1,24 @@
{config, ...}: { {
config.programs.firefox = { nur,
enable = true; enable,
}: {
profiles.kristian = { inherit enable;
isDefault = true; profiles.kristian = {
search.default = "DuckDuckGo"; isDefault = true;
search.force = true; search.default = "DuckDuckGo";
search.force = true;
extensions = with config.nur.repos.rycee.firefox-addons; [ extensions = builtins.attrValues {
inherit
(nur.repos.rycee.firefox-addons)
ublock-origin ublock-origin
umatrix umatrix
sponsorblock sponsorblock
sidebery sidebery
]; ;
};
settings = { settings = {
"extensions.pocket.enabled" = false; "extensions.pocket.enabled" = false;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
}; };
}; };
} }

View File

@ -1,11 +1,6 @@
{...}: { {enable}: {
config.programs.git = { inherit enable;
enable = true; userName = "Kristian Krsnik";
userEmail = "git@krsnik.at";
userName = "Kristian Krsnik"; extraConfig = {init.defaultBranch = "main";};
userEmail = "git@krsnik.at";
extraConfig = {
init.defaultBranch = "main";
};
};
} }

View File

@ -1,95 +1,72 @@
{ {
pkgs, lib,
wallpaper, wallpaper,
...
}: { }: {
config = { # Use `dconf watch /` to track stateful changes you are doing, then set them here.
home.packages = with pkgs.gnomeExtensions; [ "org/gnome/desktop/interface" = {
quick-settings-audio-panel color-scheme = "prefer-dark";
tray-icons-reloaded gtk-theme = "Adwaita-dark";
espresso };
pano "org/gnome/desktop/background" = let
width = 3840;
height = 2160;
in {
picture-uri = "file://${wallpaper.override {
preset = "nord-snow-aurora";
inherit width;
inherit height;
}}/share/wallpapers/nixos-wallpaper.png";
picture-uri-dark = "file://${wallpaper.override {
preset = "nord-night-aurora";
inherit width;
inherit height;
}}/share/wallpapers/nixos-wallpaper.png";
};
"org/gnome/desktop/wm/keybindings" = {
switch-to-workspace-left = ["<Alt>1"];
switch-to-workspace-right = ["<Alt>2"];
move-to-workspace-left = ["<Shift><Alt>1"];
move-to-workspace-right = ["<Shift><Alt>2"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Shift><Alt>a";
command = "kgx";
name = "Console";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
binding = "<Shift><Alt>f";
command = "nautilus";
name = "File Manager";
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
];
};
"org/gnome/settings-daemon/plugins/power" = {
sleep-inactive-ac-type = "nothing"; # Automatic suspend/hibernation creates a suspend/hibernation loop
power-button-action = "suspend";
};
"org/gnome/mutter" = {
edge-tiling = true;
dynamic-workspaces = true;
};
"org/gnome/Console" = {
theme = "auto";
};
"org/gnome/simple-scan" = {
text-dpi = 300;
};
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = [
"quick-settings-audio-panel@rayzeq.github.io"
"places-menu@gnome-shell-extensions.gcampax.github.com"
"launch-new-instance@gnome-shell-extensions.gcampax.github.com"
"trayIconsReloaded@selfmade.pl"
"espresso@coadmunkee.github.com"
"pano@elhan.io"
]; ];
dconf.settings = {
# Use `dconf watch /` to track stateful changes you are doing, then set them here.
"org/gnome/shell" = {
disable-user-extensions = false;
enabled-extensions = [
"quick-settings-audio-panel@rayzeq.github.io"
"places-menu@gnome-shell-extensions.gcampax.github.com"
"launch-new-instance@gnome-shell-extensions.gcampax.github.com"
"trayIconsReloaded@selfmade.pl"
"espresso@coadmunkee.github.com"
"pano@elhan.io"
];
};
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
gtk-theme = "Adwaita-dark";
};
"org/gnome/desktop/background" = let
width = 3840;
height = 2160;
in {
picture-uri = "file://${wallpaper.override {
preset = "nord-snow-aurora";
inherit width;
inherit height;
}}/share/wallpapers/nixos-wallpaper.png";
picture-uri-dark = "file://${wallpaper.override {
preset = "nord-night-aurora";
inherit width;
inherit height;
}}/share/wallpapers/nixos-wallpaper.png";
};
"org/gnome/desktop/wm/keybindings" = {
switch-to-workspace-left = ["<Alt>1"];
switch-to-workspace-right = ["<Alt>2"];
move-to-workspace-left = ["<Shift><Alt>1"];
move-to-workspace-right = ["<Shift><Alt>2"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Shift><Alt>a";
command = "kgx";
name = "Console";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
binding = "<Shift><Alt>f";
command = "nautilus";
name = "File Manager";
};
"org/gnome/settings-daemon/plugins/media-keys" = {
custom-keybindings = [
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/"
"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/"
];
};
"org/gnome/settings-daemon/plugins/power" = {
sleep-inactive-ac-type = "nothing"; # Automatic suspend/hibernation creates a suspend/hibernation loop
power-button-action = "suspend";
};
"org/gnome/mutter" = {
edge-tiling = true;
dynamic-workspaces = true;
};
"org/gnome/Console" = {
theme = "auto";
};
"org/gnome/simple-scan" = {
text-dpi = 300;
};
};
}; };
} }

View File

@ -1,14 +1,16 @@
{pkgs, ...}: { {
config.programs.neovim = { pkgs,
enable = true; enable,
}: {
inherit enable;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true; plugins = builtins.attrValues ({
viAlias = true; inherit
vimAlias = true; (pkgs.vimPlugins)
vimdiffAlias = true;
plugins = with pkgs.vimPlugins;
[
telescope-nvim # fuzzy finder telescope-nvim # fuzzy finder
tokyonight-nvim # theme tokyonight-nvim # theme
undotree # undotree undotree # undotree
@ -16,13 +18,17 @@
nvim-treesitter # syntax highlighting nvim-treesitter # syntax highlighting
# Autocomplete and LSP # Autocomplete and LSP
nvim-lspconfig nvim-lspconfig
nvim-cmp nvim-cmp
cmp-nvim-lsp cmp-nvim-lsp
luasnip luasnip
] ;
++ (with pkgs.vimPlugins.nvim-treesitter-parsers; [ }
# Parsers for syntax highlighting // {
# Parsers for syntax highlighting
inherit
(pkgs.vimPlugins.nvim-treesitter-parsers)
nix nix
zig zig
python python
@ -37,18 +43,17 @@
c c
glsl glsl
bash bash
]); ;
});
extraPackages = [pkgs.nodePackages.pyright]; extraPackages = [pkgs.nodePackages.pyright];
extraLuaConfig = extraLuaConfig =
builtins.readFile ./keybinds.lua builtins.readFile ./keybinds.lua
+ builtins.readFile ./colors.lua + builtins.readFile ./colors.lua
+ builtins.readFile ./undotree.lua + builtins.readFile ./undotree.lua
+ builtins.readFile ./fugitive.lua + builtins.readFile ./fugitive.lua
+ builtins.readFile ./treesitter.lua + builtins.readFile ./treesitter.lua
+ builtins.readFile ./telescope.lua + builtins.readFile ./telescope.lua
+ builtins.readFile ./cmp.lua + builtins.readFile ./cmp.lua
+ builtins.readFile ./lspconfig.lua; + builtins.readFile ./lspconfig.lua;
extraConfig = "set number relativenumber"; extraConfig = "set number relativenumber";
};
} }

View File

@ -1,48 +1,39 @@
{ {pkgs}:
pkgs, with pkgs; [
lib, # Basic utils
... unzip
}: { magic-wormhole
config.nixpkgs.config = {
allowUnfree = false;
allowUnfreePredicate = pkg: # Important graphical applications
builtins.elem (lib.getName pkg) [ keepassxc
"vscode" logseq
"vscode-extension-MS-python-vscode-pylance" xournalpp
"vscode-extension-github-copilot" onlyoffice-bin
"osu-lazer"
];
};
config.home.packages = with pkgs; [ # Communication
# Basic utils webcord
unzip telegram-desktop
magic-wormhole signal-desktop
element-desktop
# Important graphical applications # image editor
keepassxc gimp
logseq davinci-resolve
xournalpp
onlyoffice-bin
# Communication # games
webcord osu-lazer
telegram-desktop
signal-desktop
element-desktop
# Creative software # Misc
gimp nerdfonts # Font with glyphs for status bar
davinci-resolve comma # Run any binary from the repos with a comma `, cowsay neato`
# Games # Gnome extension
osu-lazer gnomeExtensions.quick-settings-audio-panel
gnomeExtensions.tray-icons-reloaded
gnomeExtensions.espresso
gnomeExtensions.pano
# Misc gnome-decoder
nerdfonts # Font with glyphs for status bar
comma # Run any binary from the repos with a comma `, cowsay neato` tor-browser-bundle-bin
gnome-decoder ]
tor-browser-bundle-bin
];
}

View File

@ -1,9 +1,6 @@
{...}: { {enable}: {
config.programs.thunderbird = { inherit enable;
enable = true; profiles.kristian = {
isDefault = true;
profiles.kristian = {
isDefault = true;
};
}; };
} }

View File

@ -1,67 +1,64 @@
{pkgs, ...}: { {
config.programs.vscode = { enable,
enable = true; pkgs,
}: {
enableUpdateCheck = false; inherit enable;
enableExtensionUpdateCheck = false; enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
keybindings = [ keybindings = [
{ {
key = "alt+a"; key = "alt+a";
command = "editor.action.commentLine"; command = "editor.action.commentLine";
when = "editorTextFocus && !editorReadonly"; when = "editorTextFocus && !editorReadonly";
} }
]; ];
extensions = with pkgs.vscode-extensions; [
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide
jnoortheen.nix-ide arrterian.nix-env-selector
arrterian.nix-env-selector mkhl.direnv
mkhl.direnv ms-python.python
ms-python.python ms-python.vscode-pylance
ms-python.vscode-pylance james-yu.latex-workshop
james-yu.latex-workshop github.copilot
github.copilot davidanson.vscode-markdownlint
davidanson.vscode-markdownlint tamasfe.even-better-toml
tamasfe.even-better-toml asciidoctor.asciidoctor-vscode
asciidoctor.asciidoctor-vscode ];
]; userSettings = {
"window.menuBarVisibility" = "hidden";
userSettings = { "[nix]" = {
"window.menuBarVisibility" = "hidden"; "editor.formatOnSave" = true;
"[nix]" = { "editor.formatOnSaveMode" = "file"; # modificationsIfAvailable does not work
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "file"; # modificationsIfAvailable does not work
};
"[python]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
};
"[latex]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "file"; # modificationsIfAvailable does not work
};
"[toml]" = {
"editor.formatOnSave" = true;
"editor.modificationsIfAvailable" = "file";
};
"python.formatting.autopep8Path" = "${pkgs.python311Packages.autopep8}/bin/autopep8";
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${pkgs.nil}/bin/nil";
"nix.serverSettings" = {
nil = {
formatting = {command = ["${pkgs.alejandra}/bin/alejandra"];};
};
};
"direnv.path.executable" = "${pkgs.direnv}/bin/direnv";
"latex-workshop.latex.outDir" = "%DIR%/out";
"terminal.integrated.profiles.linux" = {
"bash" = {
"path" = "${pkgs.bashInteractive}/bin/bash";
"args" = [];
};
};
"terminal.integrated.defaultProfile.linux" = "bash";
}; };
"[python]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
};
"[latex]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "file"; # modificationsIfAvailable does not work
};
"[toml]" = {
"editor.formatOnSave" = true;
"editor.modificationsIfAvailable" = "file";
};
"python.formatting.autopep8Path" = "${pkgs.python311Packages.autopep8}/bin/autopep8";
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${pkgs.nil}/bin/nil";
"nix.serverSettings" = {
nil = {
formatting = {command = ["${pkgs.alejandra}/bin/alejandra"];};
};
};
"direnv.path.executable" = "${pkgs.direnv}/bin/direnv";
"latex-workshop.latex.outDir" = "%DIR%/out";
"terminal.integrated.profiles.linux" = {
"bash" = {
"path" = "${pkgs.bashInteractive}/bin/bash";
"args" = [];
};
};
"terminal.integrated.defaultProfile.linux" = "bash";
}; };
} }