summary refs log tree commit diff stats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/default.nix11
-rw-r--r--sys/desktop/gnome/default.nix6
-rw-r--r--sys/desktop/plasma/default.nix14
-rw-r--r--sys/desktop/xfce/default.nix9
-rw-r--r--sys/environment/default.nix26
-rw-r--r--sys/nix/default.nix13
-rw-r--r--sys/packages/default.nix100
-rw-r--r--sys/services/flatpak/default.nix11
-rw-r--r--sys/services/zsh/default.nix44
-rw-r--r--sys/users/default.nix22
10 files changed, 256 insertions, 0 deletions
diff --git a/sys/default.nix b/sys/default.nix
new file mode 100644
index 0000000..5f4babf
--- /dev/null
+++ b/sys/default.nix
@@ -0,0 +1,11 @@
+{...}: {
+  imports = [
+    ./desktop/gnome
+    ./environment
+    ./nix
+    ./packages
+    ./services/flatpak
+    ./services/zsh
+    ./users
+  ];
+}
diff --git a/sys/desktop/gnome/default.nix b/sys/desktop/gnome/default.nix
new file mode 100644
index 0000000..dbeb0f6
--- /dev/null
+++ b/sys/desktop/gnome/default.nix
@@ -0,0 +1,6 @@
+{...}: {
+  services.xserver.enable = true;
+
+  services.xserver.displayManager.gdm.enable = true;
+  services.xserver.desktopManager.gnome.enable = true;
+}
diff --git a/sys/desktop/plasma/default.nix b/sys/desktop/plasma/default.nix
new file mode 100644
index 0000000..4198029
--- /dev/null
+++ b/sys/desktop/plasma/default.nix
@@ -0,0 +1,14 @@
+{pkgs, ...}: {
+  services.xserver = {
+    enable = true;
+    displayManager.sddm.enable = true;
+    desktopManager.plasma5 = {
+      enable = true;
+      excludePackages = with pkgs.libsForQt5; [
+        kwallet
+        kwallet-pam
+        kwalletmanager
+      ];
+    };
+  };
+}
diff --git a/sys/desktop/xfce/default.nix b/sys/desktop/xfce/default.nix
new file mode 100644
index 0000000..b0de71a
--- /dev/null
+++ b/sys/desktop/xfce/default.nix
@@ -0,0 +1,9 @@
+{...}: {
+  services = {
+    blueman.enable = true;
+    xserver = {
+      enable = true;
+      desktopManager.xfce.enable = true;
+    };
+  };
+}
diff --git a/sys/environment/default.nix b/sys/environment/default.nix
new file mode 100644
index 0000000..8f58641
--- /dev/null
+++ b/sys/environment/default.nix
@@ -0,0 +1,26 @@
+{...}: {
+  environment.sessionVariables = rec {
+    XDG_CACHE_HOME = "\${HOME}/.cache";
+    XDG_CONFIG_HOME = "\${HOME}/.config";
+    XDG_BIN_HOME = "\${HOME}/.local/bin";
+    XDG_DATA_HOME = "\${HOME}/.local/share";
+    XDG_STATE_HOME = "\${HOME}/.local/state";
+    ZDOTDIR = "\${HOME}/.config/zsh";
+    CARGO_HOME = "\${HOME}/.local/share/cargo";
+    ANDROID_HOME = "\${HOME}/.local/share/android";
+    ANSIBLE_HOME = "\${HOME}/.local/share/ansible";
+    #_JAVA_OPTIONS	= '-Djava.util.prefs.userRoot="\${XDG_CONFIG_HOME}/java"';
+    WINEPREFIX = "\${HOME}/.local/share/wine";
+    GNUPGHOME = "\${HOME}/.local/share/gnupg";
+    GRADLE_USER_HOME = "\${HOME}/.local/share/gradle";
+    GTK2_RC_FILES = "\${HOME}/.config/gtk-2.0/gtkrc";
+    EDITOR = "nvim";
+    GOPATH = "\${HOME}/.local/share/go";
+    XCOMPOSECACHE = "\${HOME}/.cache/X11/xcompose";
+    #PYTHONSTARTUP="/etc/python/pythonrc";
+
+    PATH = [
+      "\${XDG_BIN_HOME}"
+    ];
+  };
+}
diff --git a/sys/nix/default.nix b/sys/nix/default.nix
new file mode 100644
index 0000000..30f5b38
--- /dev/null
+++ b/sys/nix/default.nix
@@ -0,0 +1,13 @@
+{...}: {
+  nix = {
+    gc = {
+      automatic = true;
+      dates = "daily";
+      options = "--delete-older-than 3";
+    };
+    settings = {
+      auto-optimise-store = true;
+      experimental-features = ["nix-command" "flakes"];
+    };
+  };
+}
diff --git a/sys/packages/default.nix b/sys/packages/default.nix
new file mode 100644
index 0000000..db97b9b
--- /dev/null
+++ b/sys/packages/default.nix
@@ -0,0 +1,100 @@
+{
+  pkgs,
+  lib,
+  ...
+}: {
+  environment.systemPackages = with pkgs; [
+    # Core utils
+    killall # kill programs by name
+    wget # download stuff
+    curl # download stuff – reloaded
+    fd # faster find
+    neofetch # a must-have
+    zsh # the one and only shell
+
+    # archives
+    unzip
+    zip
+    _7zz
+
+    neovim # edit nix files ;)
+    inkscape # vector graphics
+
+    restic # backups
+    thunderbird # emails
+    firefox # my browser
+    librewolf # privacy friendly firefox
+    ungoogled-chromium # the only chromium-based browser I'd ever use.
+    google-chrome # breaking promises
+    element-desktop # chat
+    libreoffice # convert doc to pdf xD
+    pdfarranger # gui for pdf arranging
+
+    keepassxc # passwords
+    bitwarden # cloud passwords
+
+    gnome.gnome-keyring # to tired to migrate to kwallet
+    gnome.simple-scan # scanning, obiously
+    lsd # ls in good
+    jq # xdg-ninja requieres that
+    glow # markdown rendering
+    xdg-ninja # home cleaning
+    git # versioning
+    signal-desktop # the ecosystem is moving :(
+    signal-cli # use signal without phone
+    mumble # voice chat
+
+    #Nix Stuff
+    alejandra # nix code formatter
+    nil # nix language-server
+    statix # nix linter
+
+    # SSH Stuff
+    openssh # ssh
+    mosh # ssh in great
+
+    jdk17 # openjdk17 to satisfy mr.antoine
+    rustc # rust, obiously
+    cargo # cargo, the best compiler ever"
+    lf # a file manager
+
+    gnupg # encryprtion and so on
+    pinentry # needed for gpg
+
+    tor-browser-bundle-bin # tor-browser
+    tdesktop # another messenger (telegram)
+    libsForQt5.kdeconnect-kde # communicate with my phone
+    imagemagick # convertion and so on
+    #nerdfonts # nice fonts, u know
+    alacritty # terminal
+    konsole # terminal
+
+    zsh-you-should-use # reminder for aliasses
+    jetbrains.idea-community # Java-IDE
+    python39 # python programming language
+    sayonara # audioplayer
+    vlc # audio, again
+    nmap # network scanning
+    tree # tree view of directories
+    youtube-dl # download videos
+    mpv # play videos
+    texlive.combined.scheme-full # LaTeX
+    gparted # partitioning :(
+    musescore # notesetting program
+    geogebra # math program
+    # Compiler
+    gcc
+    execline
+
+    ltex-ls # lsp language server for languagetool
+    texlab # latex language server
+    html-tidy # html formatter
+
+    bottles # run windows software
+  ];
+  nixpkgs.config.allowUnfreePredicate = pkg:
+    builtins.elem (lib.getName pkg) [
+      "geogebra"
+      "google-chrome"
+    ];
+}
diff --git a/sys/services/flatpak/default.nix b/sys/services/flatpak/default.nix
new file mode 100644
index 0000000..d1f4586
--- /dev/null
+++ b/sys/services/flatpak/default.nix
@@ -0,0 +1,11 @@
+{...}: {
+  services.flatpak.enable = true;
+  fileSystems."/var/lib/flatpak" = {
+    device = "/srv/flatpak";
+    options = ["bind"];
+  };
+  #  xdg.portal = {
+  #    enable = true;
+  #    extraPortals = [pkgs.xdg-desktop-portal-gtk];
+  #  };
+}
diff --git a/sys/services/zsh/default.nix b/sys/services/zsh/default.nix
new file mode 100644
index 0000000..b8349f9
--- /dev/null
+++ b/sys/services/zsh/default.nix
@@ -0,0 +1,44 @@
+{pkgs, ...}: {
+  programs.zsh = {
+    enable = true;
+    syntaxHighlighting.enable = true;
+    autosuggestions.enable = true;
+    interactiveShellInit = ''
+        	export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh/
+      export fpath=("$XDG_DATA_HOME/zsh/site-functions" $fpath)
+      HISTFILE="$XDG_STATE_HOME/zsh/history"
+
+      plugins=(git)
+
+      alias vim="nvim"
+      alias ls='lsd'
+      alias l='ls -l'
+      alias la='ls -a'
+      alias lla='ls -la'
+      alias lt='ls --tree'
+      alias rebackup='restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd backup'
+      alias repreconf='restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd'
+      alias b-del="sudo btrfs subv delet /srv/snapshots/home"
+      alias b-shot="sudo btrfs subvolume snapshot -r /home /srv/snapshots/home"
+      alias b-home='[ -d /srv/snapshots/home ] && sudo btrfs subvolume delete /srv/snapshots/home; sudo btrfs subvolume snapshot -r /home /srv/snapshots/home; sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache backup /srv/snapshots/home;'
+      alias r-clean="sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache forget \
+                            	--keep-weekly  7  \
+                            	--keep-daily   7  \
+                            	--keep-monthly 6  \
+                            	--keep-yearly  10 \
+                            	--keep-hourly  5  \
+                            	--keep-tag prs"
+      alias r-prune="sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache prune"
+      alias r-check="sudo restic -r /mnt/storage/backups --cache-dir /srv/.restic-cache --password-file ~/srv/.restic_pswd check"
+      alias zconf="vim ~/.config/zsh/.zshrc"
+      alias zenv="vim ~/.config/zsh/.zshenv"
+      alias o="xdg-open"
+      alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
+
+
+      source $ZSH/oh-my-zsh.sh
+    '';
+
+    promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
+  };
+}
diff --git a/sys/users/default.nix b/sys/users/default.nix
new file mode 100644
index 0000000..7f1e7d2
--- /dev/null
+++ b/sys/users/default.nix
@@ -0,0 +1,22 @@
+{pkgs, ...}: {
+  users = {
+    mutableUsers = false;
+    users.sils = {
+      isNormalUser = true;
+      home = "/home/sils";
+      shell = pkgs.zsh;
+      initialHashedPassword = "$y$j9T$r4578Hy9jZHmUH9uSr9OI.$SuR2anRq7EJ1gUJ6vi9qYmZrhLP.o3O5643IG6r5Ap/";
+      extraGroups = ["wheel" "networkmanager"];
+    };
+    users.cnnr = {
+      isNormalUser = true;
+      home = "/home/cnnr";
+      shell = pkgs.zsh;
+      initialHashedPassword = "$y$j9T$NFz0d2coUOvl.hL3YRwEY0$8btvXUoWGWwo11ksdt8eIFUljCkpUe0YliEy7l0odU1";
+    };
+  };
+  services.xserver.displayManager.autoLogin = {
+    enable = true;
+    user = "sils";
+  };
+}