changed structure

This commit is contained in:
Kristian Krsnik 2023-08-26 18:35:30 +02:00
parent b49e4656f2
commit 0444229bb0
11 changed files with 278 additions and 267 deletions

View File

@ -5,6 +5,7 @@
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";
@ -33,7 +34,7 @@
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
in { in {
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra; formatter.${system} = pkgs.alejandra;
homeConfigurations = { homeConfigurations = {
kristian = home-manager.lib.homeManagerConfiguration { kristian = home-manager.lib.homeManagerConfiguration {
@ -49,7 +50,7 @@
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
zig.overlays.default # Adds zig zig.overlays.default # Add 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,8 +1,11 @@
{enable}: { {...}: {
inherit enable; config.programs.bash = {
enable = true;
shellAliases = { shellAliases = {
ll = "ls -lh"; ll = "ls -lh";
la = "ls -lah"; la = "ls -lah";
".." = "cd .."; ".." = "cd ..";
}; };
};
} }

View File

@ -1,11 +1,9 @@
{ {
config, config,
pkgs,
lib, lib,
options, options,
specialArgs, specialArgs,
modulesPath, modulesPath,
wallpaper,
}: { }: {
nixpkgs.config.allowUnfreePredicate = _: true; nixpkgs.config.allowUnfreePredicate = _: true;
@ -18,19 +16,23 @@
NIXOS_OZONE_WL = 1; NIXOS_OZONE_WL = 1;
}; };
# TODO: Change for Laptop # Keyboard Layout
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
# Keyboard Layout imports = [
home.keyboard.layout = "at"; # NOTE: Set by Hyprland config ./bash.nix
./direnv.nix
# Programs (additional programs) ./firefox.nix
home.packages = import ./packages.nix {inherit pkgs;}; ./git.nix
./gnome.nix
# Services ./nvim
services = { ./packages.nix
copyq.enable = true; ./thunderbird.nix
}; ./vscode.nix
];
# Programs # Programs
programs = { programs = {
@ -38,29 +40,16 @@
mpv.enable = true; mpv.enable = true;
obs-studio.enable = true; obs-studio.enable = true;
yt-dlp.enable = true; yt-dlp.enable = true;
bash = import ./bash.nix {enable = true;};
vscode = import ./vscode.nix {
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 { # Services
enable = true; services = {
nur = config.nur; copyq.enable = true;
};
}; };
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"];
@ -68,10 +57,4 @@
"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,5 +1,8 @@
{enable}: { {...}: {
inherit enable; config.programs.direnv = {
nix-direnv.enable = enable; enable = true;
nix-direnv.enable = true;
enableBashIntegration = true; enableBashIntegration = true;
};
} }

View File

@ -1,24 +1,23 @@
{ {config, ...}: {
nur, config.programs.firefox = {
enable, enable = true;
}: {
inherit enable;
profiles.kristian = { profiles.kristian = {
isDefault = true; isDefault = true;
search.default = "DuckDuckGo"; search.default = "DuckDuckGo";
search.force = true; search.force = true;
extensions = builtins.attrValues {
inherit extensions = with config.nur.repos.rycee.firefox-addons; [
(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,6 +1,11 @@
{enable}: { {...}: {
inherit enable; config.programs.git = {
enable = true;
userName = "Kristian Krsnik"; userName = "Kristian Krsnik";
userEmail = "git@krsnik.at"; userEmail = "git@krsnik.at";
extraConfig = {init.defaultBranch = "main";}; extraConfig = {
init.defaultBranch = "main";
};
};
} }

View File

@ -1,63 +1,18 @@
{ {
lib, pkgs,
wallpaper, wallpaper,
...
}: { }: {
# Use `dconf watch /` to track stateful changes you are doing, then set them here. config = {
"org/gnome/desktop/interface" = { home.packages = with pkgs.gnomeExtensions; [
color-scheme = "prefer-dark"; quick-settings-audio-panel
gtk-theme = "Adwaita-dark"; tray-icons-reloaded
}; espresso
"org/gnome/desktop/background" = let pano
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" = { dconf.settings = {
sleep-inactive-ac-type = "nothing"; # Automatic suspend/hibernation creates a suspend/hibernation loop # Use `dconf watch /` to track stateful changes you are doing, then set them here.
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" = { "org/gnome/shell" = {
disable-user-extensions = false; disable-user-extensions = false;
enabled-extensions = [ enabled-extensions = [
@ -69,4 +24,72 @@
"pano@elhan.io" "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,16 +1,14 @@
{ {pkgs, ...}: {
pkgs, config.programs.neovim = {
enable, enable = true;
}: {
inherit enable;
defaultEditor = true; defaultEditor = true;
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
vimdiffAlias = true; vimdiffAlias = true;
plugins = builtins.attrValues ({ plugins = with pkgs.vimPlugins;
inherit [
(pkgs.vimPlugins)
telescope-nvim # fuzzy finder telescope-nvim # fuzzy finder
tokyonight-nvim # theme tokyonight-nvim # theme
undotree # undotree undotree # undotree
@ -18,17 +16,13 @@
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
@ -43,8 +37,8 @@
c c
glsl glsl
bash bash
; ]);
});
extraPackages = [pkgs.nodePackages.pyright]; extraPackages = [pkgs.nodePackages.pyright];
extraLuaConfig = extraLuaConfig =
builtins.readFile ./keybinds.lua builtins.readFile ./keybinds.lua
@ -56,4 +50,5 @@
+ 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,5 +1,5 @@
{pkgs}: {pkgs, ...}: {
with pkgs; [ config.home.packages = with pkgs; [
# Basic utils # Basic utils
unzip unzip
magic-wormhole magic-wormhole
@ -16,24 +16,17 @@ with pkgs; [
signal-desktop signal-desktop
element-desktop element-desktop
# image editor # Creative software
gimp gimp
davinci-resolve davinci-resolve
# games # Games
osu-lazer osu-lazer
# Misc # Misc
nerdfonts # Font with glyphs for status bar nerdfonts # Font with glyphs for status bar
comma # Run any binary from the repos with a comma `, cowsay neato` comma # Run any binary from the repos with a comma `, cowsay neato`
# Gnome extension
gnomeExtensions.quick-settings-audio-panel
gnomeExtensions.tray-icons-reloaded
gnomeExtensions.espresso
gnomeExtensions.pano
gnome-decoder gnome-decoder
tor-browser-bundle-bin tor-browser-bundle-bin
] ];
}

View File

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

View File

@ -1,10 +1,10 @@
{ {pkgs, ...}: {
enable, config.programs.vscode = {
pkgs, enable = true;
}: {
inherit enable;
enableUpdateCheck = false; enableUpdateCheck = false;
enableExtensionUpdateCheck = false; enableExtensionUpdateCheck = false;
keybindings = [ keybindings = [
{ {
key = "alt+a"; key = "alt+a";
@ -12,6 +12,7 @@
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
@ -24,6 +25,7 @@
tamasfe.even-better-toml tamasfe.even-better-toml
asciidoctor.asciidoctor-vscode asciidoctor.asciidoctor-vscode
]; ];
userSettings = { userSettings = {
"window.menuBarVisibility" = "hidden"; "window.menuBarVisibility" = "hidden";
"[nix]" = { "[nix]" = {
@ -61,4 +63,5 @@
}; };
"terminal.integrated.defaultProfile.linux" = "bash"; "terminal.integrated.defaultProfile.linux" = "bash";
}; };
};
} }