diff --git a/shared/client/backups.nix b/features/client/backups.nix similarity index 100% rename from shared/client/backups.nix rename to features/client/backups.nix diff --git a/shared/client/default.nix b/features/client/default.nix similarity index 100% rename from shared/client/default.nix rename to features/client/default.nix diff --git a/shared/client/games.nix b/features/client/games.nix similarity index 100% rename from shared/client/games.nix rename to features/client/games.nix diff --git a/features/client/home-manager/home.nix b/features/client/home-manager/home.nix new file mode 100644 index 0000000..ef691e7 --- /dev/null +++ b/features/client/home-manager/home.nix @@ -0,0 +1,81 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "katz"; + home.homeDirectory = "/home/katz"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "24.05"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = [ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + pkgs.neovim + pkgs.openarena + pkgs.xonotic + pkgs.jellyfin-mpv-shim + pkgs.bitwarden-cli + pkgs.moonlight-qt + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/katz/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + EDITOR = "nvim"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/shared/client/sway.nix b/features/client/sway.nix similarity index 100% rename from shared/client/sway.nix rename to features/client/sway.nix diff --git a/shared/client/tailscale.nix b/features/client/tailscale.nix similarity index 100% rename from shared/client/tailscale.nix rename to features/client/tailscale.nix diff --git a/shared/client/udisks2.nix b/features/client/udisks2.nix similarity index 100% rename from shared/client/udisks2.nix rename to features/client/udisks2.nix diff --git a/features/client/vesktop.nix b/features/client/vesktop.nix new file mode 100644 index 0000000..f56c4cd --- /dev/null +++ b/features/client/vesktop.nix @@ -0,0 +1,3 @@ +{ + + } diff --git a/shared/isos/goober.nix b/features/isos/goober.nix similarity index 100% rename from shared/isos/goober.nix rename to features/isos/goober.nix diff --git a/shared/ssh.nix b/features/shared/ssh.nix similarity index 66% rename from shared/ssh.nix rename to features/shared/ssh.nix index 99a0f58..4400ec3 100644 --- a/shared/ssh.nix +++ b/features/shared/ssh.nix @@ -1,8 +1,4 @@ -{ - config, - - ... -}: +{ config, ... }: { services.openssh = { enable = true; @@ -15,12 +11,11 @@ services.fail2ban.jails.sshd.settings = { ssh = '' - enabled = true - port = ssh - filter = sshd - logpath = %(sshd_log)s - maxretry = 5 + enabled = true + port = ssh + filter = sshd + logpath = %(sshd_log)s + maxretry = 5 ''; }; - } diff --git a/flake.nix b/flake.nix index b8e9691..e86b430 100644 --- a/flake.nix +++ b/flake.nix @@ -18,10 +18,6 @@ flake = false; }; - miovim = { - url = "https://git.hypervirtual.world/harry123/miovim"; - }; - nixos-generators = { url = "github:nix-community/nixos-generators"; inputs.nixpkgs.follows = "nixpkgs"; @@ -29,8 +25,13 @@ nix-darwin.url = "github:LnL7/nix-darwin"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=v0.4.1"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; walker.url = "github:abenz1267/walker"; }; @@ -47,7 +48,6 @@ nix-flatpak, home-manager, nixvim, - miovim, ... }@inputs: let @@ -153,18 +153,6 @@ ]; format = "proxmox"; }; - - diva = nixos-generators.nixosGenerate { - system = "x86_64-linux"; - specialArgs = { - diskSize = 20 * 1024; - inherit specialArgs; - }; - modules = [ - ./hosts/diva/configuration.nix - ]; - format = "proxmox"; - }; }; darwinConfigurations."iMac-de-Eddie" = nix-darwin.lib.darwinSystem { diff --git a/home-manager/dotfiles/sway/scripts/screen_and_copy.sh b/home-manager/dotfiles/sway/scripts/screen_and_copy.sh index 7aecdc5..95b05ec 100755 --- a/home-manager/dotfiles/sway/scripts/screen_and_copy.sh +++ b/home-manager/dotfiles/sway/scripts/screen_and_copy.sh @@ -4,10 +4,4 @@ elif [ "$1" = "output" ]; then SCREENPATH=$(grimshot save output) fi -if [[ -f "$SCREENPATH" ]]; then - cat "$SCREENPATH" | wl-copy -t image/png - echo "Screenshot copied to clipboard :3" -else - echo "oh noes it failed... no file at $SCREENPATH" - exit 1 -fi +cat $SCREENPATH | wl-copy -t image/png diff --git a/hosts/diva/configuration.nix b/hosts/diva/configuration.nix deleted file mode 100644 index 4d1235d..0000000 --- a/hosts/diva/configuration.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ inputs, ... }: -{ - imports = [ ./features ]; - networking.hostName = "diva"; # Define your hostname. - - networking.firewall = { - enable = true; - allowedTCPPorts = [ - 22 # ssh - 80 # http - 443 # ssl - ]; - }; - - # reducing disk usage - boot.loader.systemd-boot.configurationLimit = 10; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 1w"; - }; - - nix.settings.auto-optimise-store = true; - services.caddy.enable = true; -} diff --git a/hosts/diva/features/backups.nix b/hosts/diva/features/backups.nix deleted file mode 100644 index 101c0e6..0000000 --- a/hosts/diva/features/backups.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ ... }: -{ - services.borgmatic.enable = true; -} diff --git a/hosts/diva/features/default.nix b/hosts/diva/features/default.nix deleted file mode 100644 index 398d8f8..0000000 --- a/hosts/diva/features/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, ... }: -{ - imports = [ - ./backups.nix - ./fail2ban.nix - ./nextcloud.nix - ./uptime-kuma.nix - ]; -} diff --git a/hosts/diva/features/fail2ban.nix b/hosts/diva/features/fail2ban.nix deleted file mode 100644 index 367633f..0000000 --- a/hosts/diva/features/fail2ban.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ config, ... }: -{ - -} diff --git a/hosts/diva/features/nextcloud.nix b/hosts/diva/features/nextcloud.nix deleted file mode 100644 index a37407f..0000000 --- a/hosts/diva/features/nextcloud.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -{ - imports = [ - "${ - fetchTarball { - url = "https://github.com/onny/nixos-nextcloud-testumgebung/archive/fa6f062830b4bc3cedb9694c1dbf01d5fdf775ac.tar.gz"; - sha256 = "0gzd0276b8da3ykapgqks2zhsqdv4jjvbv97dsxg0hgrhb74z0fs"; - } - }/nextcloud-extras.nix" - ./nextcloud-network.nix - ]; # adding caddy support - - sops.secrets.adminNextcloudPass = { - owner = "nextcloud"; - }; - - services.nextcloud = { - enable = true; - hostName = "cloud.hypervirtual.world"; - database.createLocally = true; - webserver = "caddy"; - configureRedis = true; - package = pkgs.nextcloud30; - config = { - dbtype = "pgsql"; - adminpassFile = config.sops.secrets.adminNextcloudPass.path; - }; - - settings = { - enabledPreviewProviders = [ - "OC\\Preview\\BMP" - "OC\\Preview\\GIF" - "OC\\Preview\\JPEG" - "OC\\Preview\\Krita" - "OC\\Preview\\MarkDown" - "OC\\Preview\\MP3" - "OC\\Preview\\OpenDocument" - "OC\\Preview\\PNG" - "OC\\Preview\\TXT" - "OC\\Preview\\XBitmap" - "OC\\Preview\\HEIC" - ]; - - trustedDomains = [ "cloud.hypervirtual.world" ]; - overwriteprotocol = "https"; - log_type = "file"; # temporary fix for https://nixos.org/manual/nixos/stable/#module-services-nextcloud-warning-logreader - default_phone_region = "FR"; - default_locale = "fr_FR"; - default_language = "fr"; - default_timezone = "Europe/Paris"; - "memories.exiftool" = "${lib.getExe pkgs.exiftool}"; - }; - - phpExtraExtensions = all: [ - all.pdlib - all.redis - all.bz2 - ]; - - phpOptions."opcache.interned_strings_buffer" = "23"; - appstoreEnable = true; # why i would want appstore to be disabled ??? - autoUpdateApps.enable = true; - cli.memoryLimit = "4G"; - }; - - environment.systemPackages = - let - php = pkgs.php.buildEnv { extraConfig = "memory_limit = 4G"; }; - in - [ - php - ]; -} diff --git a/hosts/diva/features/uptime-kuma.nix b/hosts/diva/features/uptime-kuma.nix deleted file mode 100644 index c3726d6..0000000 --- a/hosts/diva/features/uptime-kuma.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ ... }: -{ - services.uptime-kuma = { - enable = true; - settings = { - PORT = "4000"; - }; - }; - - services.caddy.virtualHosts."http://status.hypervirtual.world".extraConfig = '' - reverse_proxy :4000 - ''; - - services.caddy.virtualHosts."http://uptime.sisyphe.normandy.hypervirtual.world".extraConfig = '' - reverse_proxy :4000 - ''; -} diff --git a/hosts/sisyphe/configuration.nix b/hosts/sisyphe/configuration.nix index 20deb33..977b5eb 100644 --- a/hosts/sisyphe/configuration.nix +++ b/hosts/sisyphe/configuration.nix @@ -5,7 +5,7 @@ secrets, ... }: -let +let ip = "192.168.1.177"; gateway = "192.168.1.1"; username = "homelab"; @@ -13,8 +13,8 @@ in { imports = [ ./hardware-configuration.nix - ./features - ../shared + ./features/default.nix + ../../features/shared/ssh.nix ]; # Use the GRUB 2 boot loader. @@ -25,6 +25,23 @@ in services.qemuGuest.enable = true; networking.hostName = "sisyphe"; # Define your hostname. + # Set your time zone. + time.timeZone = lib.mkDefault "Europe/Paris"; + + i18n.defaultLocale = "fr_FR.UTF-8"; + console = { + font = "Lat2-Terminus16"; + keyMap = "fr"; + }; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + system.autoUpgrade.enable = true; + system.autoUpgrade.allowReboot = true; + users.users.homelab = { isNormalUser = true; extraGroups = [ @@ -51,8 +68,11 @@ in environment.systemPackages = with pkgs; [ git neovim + curl ]; + environment.variables.EDITOR = "nvim"; + # setting up networking!! networking = { interfaces = { @@ -105,6 +125,15 @@ in sops.age.generateKey = true; sops.defaultSopsFile = "${secrets}/secrets/secrets.yaml"; + # reducing disk usage + boot.loader.systemd-boot.configurationLimit = 10; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 1w"; + }; + nix.settings.auto-optimise-store = true; + # sonarr needs some EoL packages to be build nixpkgs.config.permittedInsecurePackages = [ "aspnetcore-runtime-6.0.36" @@ -114,11 +143,10 @@ in ]; # seems like sabnzbd needs some unfree pkgs... - nixpkgs.config.allowUnfreePredicate = - pkg: - builtins.elem (lib.getName pkg) [ - "unrar" - ]; + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "unrar" + ]; + # This option defines the first version of NixOS you have installed on this particular machine, # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. @@ -138,4 +166,5 @@ in # # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . system.stateVersion = "24.05"; # Did you read the comment? + } diff --git a/hosts/sisyphe/features/default.nix b/hosts/sisyphe/features/default.nix index 15a63fb..0b54b2e 100644 --- a/hosts/sisyphe/features/default.nix +++ b/hosts/sisyphe/features/default.nix @@ -1,10 +1,10 @@ { config, pkgs, ... }: { imports = [ - ./containers - ./multimedia - ./databases - ./services + ./containers/default.nix + ./multimedia/default.nix + ./databases/default.nix + ./services/default.nix ./backups.nix ./caddy.nix ./prometheus.nix diff --git a/shared/default.nix b/shared/default.nix deleted file mode 100644 index f335412..0000000 --- a/shared/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - pkgs, - inputs, - system, - lib, - ... -}: -{ - imports = [ - ../shared - ]; - - environment.systemPackages = [ - inputs.miovim.packages.${system}.default - pkgs.curl - pkgs.unzip - ]; - - environment.variables.EDITOR = "nvim"; - - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - - console = { - font = "Lat2-Terminus16"; - keyMap = "fr"; - }; - - services.tailscale.enable = true; - - # Set your time zone. - time.timeZone = lib.mkDefault "Europe/Paris"; - i18n.defaultLocale = "fr_FR.UTF-8"; - - # reducing disk usage - boot.loader.systemd-boot.configurationLimit = 10; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 1w"; - }; - nix.settings.auto-optimise-store = true; -}