diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..65326bb --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix \ No newline at end of file diff --git a/flake.lock b/flake.lock index 1be71a3..d1b0ffe 100644 --- a/flake.lock +++ b/flake.lock @@ -99,11 +99,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1762844143, - "narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=", + "lastModified": 1763283776, + "narHash": "sha256-Y7TDFPK4GlqrKrivOcsHG8xSGqQx3A6c+i7novT85Uk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4", + "rev": "50a96edd8d0db6cc8db57dab6bb6d6ee1f3dc49a", "type": "github" }, "original": { @@ -121,11 +121,11 @@ ] }, "locked": { - "lastModified": 1763025011, - "narHash": "sha256-LpEYbvuPeeeWsrN3fTJZRJJwEBasoraA9osRWIHacC4=", + "lastModified": 1763369811, + "narHash": "sha256-JzGbEE9w/LTHRqeV76rzIBLMGZzhEyBq1h/xLd0bHf8=", "owner": "nix-community", "repo": "NUR", - "rev": "4cbf270857000bdd7af7ee52a7bc72448a299dec", + "rev": "ce3d701015f40c55659133a3bbf9920815c7ed7b", "type": "github" }, "original": { @@ -142,11 +142,11 @@ ] }, "locked": { - "lastModified": 1763025011, - "narHash": "sha256-LpEYbvuPeeeWsrN3fTJZRJJwEBasoraA9osRWIHacC4=", + "lastModified": 1763369811, + "narHash": "sha256-JzGbEE9w/LTHRqeV76rzIBLMGZzhEyBq1h/xLd0bHf8=", "owner": "nix-community", "repo": "NUR", - "rev": "4cbf270857000bdd7af7ee52a7bc72448a299dec", + "rev": "ce3d701015f40c55659133a3bbf9920815c7ed7b", "type": "github" }, "original": { diff --git a/home/alisceon/base.nix b/home/alisceon/base.nix index 50e85bf..638a7ee 100644 --- a/home/alisceon/base.nix +++ b/home/alisceon/base.nix @@ -116,6 +116,7 @@ direnv = { enable = true; silent = true; + nix-direnv.enable = true; }; # end direnv }; # end programs # nixpkgs config diff --git a/home/conf/xonsh/xonshrc b/home/conf/xonsh/xonshrc index 899e89c..9eebac2 100644 --- a/home/conf/xonsh/xonshrc +++ b/home/conf/xonsh/xonshrc @@ -32,7 +32,6 @@ XSH.env['fzf_dir_binding'] = "c-g" # Ctrl+G ## ALIASES ## aliases["tsla-fan"] = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0" aliases["nixoss"] = "sudo nixos-rebuild switch --flake .#${config.networking.hostName}" -aliases["nixossu"] = "sudo nixos-rebuild switch --update-input nixpkgs --flake .#${config.networking.hostName}" aliases["nixost"] = "sudo nixos-rebuild test --flake .#${config.networking.hostName}" aliases["nixosdb"] = "sudo nixos-rebuild dry-build --flake .#${config.networking.hostName}" aliases["devt"] = "devenv test" diff --git a/hosts/alisceon-core/configuration.nix b/hosts/alisceon-core/configuration.nix deleted file mode 100644 index e6a4de8..0000000 --- a/hosts/alisceon-core/configuration.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = - [ ./hardware-configuration.nix ]; - networking.hostName = "alisceon-core"; - boot.initrd.enable = true; - boot.loader = { - systemd-boot = { - enable = true; - }; # end loader.systemd-boot - }; # end boot -} # end file diff --git a/hosts/blogbox/configuration.nix b/hosts/blogbox/configuration.nix deleted file mode 100644 index 386eff5..0000000 --- a/hosts/blogbox/configuration.nix +++ /dev/null @@ -1,115 +0,0 @@ -{ config, pkgs, ... }: -let - hugoDir = "/home/alisceon/blog"; -in -{ - imports = - [ ./hardware-configuration.nix ]; - networking.hostName = "blogbox"; - boot.initrd.enable = true; - boot.loader = { - systemd-boot = { - enable = true; - }; # end loader.systemd-boot - }; # end boot - networking.firewall = { - enable = true; - allowedTCPPorts = [ 22 80 443 ]; - allowedUDPPorts = [ 443 ]; - }; - environment = { - systemPackages = with pkgs; [ - hugo - caddy - ddclient - ]; # end systemPackages - }; # end environment - systemd = { - services = { - "pull-blog" = { - wantedBy = [ "multi-user.target" ]; - script = '' - git pull origin main - hugo - ''; - serviceConfig = { - type = "oneshot"; - user = "alisceon"; - workingDirectory = hugoDir; - }; # end serviceConfig - }; # end pull-blog - "ddclient" = { - description = "Dynamic DNS client"; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - ExecStart = "${pkgs.ddclient}/bin/ddclient -foreground -file /etc/blogbox/ddclient.conf"; - Restart = "on-failure"; - User = "root"; - EnvironmentFile = "/etc/blogbox/.env"; - }; # end serviceConfig - }; # end ddclient - }; # end services - timers = { - "pull-blog" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "5min"; - OnUnitActiveSec = "5min"; - Persistent = true; - }; # end timerConfig - }; # end pull-blog - "ddclient" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "5min"; - OnUnitActiveSec = "5min"; - Persistent = true; - }; # end timerConfig - }; # end ddclient - }; # end timers - }; # end systemd - services= { - caddy = { - enable = true; - environmentFile = "/etc/blogbox/.env"; - virtualHosts = { - "blog" = { - hostName = "${DOMAIN}"; - forceSSL = true; - root = "${hugoDir}/public"; - index = "index.html"; - log = [ "stdout" "stderr" ]; - fileServer = { }; - tls = { - email = "" - }; # end tls - }; # end {$DOMAIN} - }; # end virtualHosts - }; # end caddy - }; # end services.caddy - environment = { - etc = { - "blogbox/ddclient.conf" = { - text = '' - use=web, web=dynamicdns.park-your-domain.com/getip - protocol=namecheap - server=dynamicdns.park-your-domain.com - login_env=DOMAIN - password_env=DDNS_PASSWORD - @ - ''; - mode = "600"; - }; - "blogbox/.env.example" = { - text = '' - HUGO_DIR=${hugoDir} - HUGO_ENV=production - DOMAIN=example.com - DDNS_PASSWORD=yourpassword - NAMECHEAP_API_KEY=yourapikey - ''; - mode = "600"; - }; - }; # end etc - }; -} # end file diff --git a/hosts/common.nix b/hosts/common.nix deleted file mode 100644 index 64ecfc9..0000000 --- a/hosts/common.nix +++ /dev/null @@ -1,131 +0,0 @@ -{ config, pkgs, ... }: - -{ - system.stateVersion = "24.05"; - nix.settings = { - experimental-features = [ "nix-command" "flakes" ]; - auto-optimise-store = true; - trusted-users = [ "root" "alisceon" ]; - }; # end nix settings - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; # end nix gc - - console.keyMap = "sv-latin1"; - networking.networkmanager.enable = true; - time.timeZone = "Europe/Stockholm"; - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "sv_SE.UTF-8"; - LC_IDENTIFICATION = "sv_SE.UTF-8"; - LC_MEASUREMENT = "sv_SE.UTF-8"; - LC_MONETARY = "sv_SE.UTF-8"; - LC_NAME = "sv_SE.UTF-8"; - LC_NUMERIC = "sv_SE.UTF-8"; - LC_PAPER = "sv_SE.UTF-8"; - LC_TELEPHONE = "sv_SE.UTF-8"; - LC_TIME = "sv_SE.UTF-8"; - }; - security.sudo.wheelNeedsPassword = false; - - services = { - printing.enable = true; - pulseaudio.enable = false; - pipewire = { - enable = true; - alsa.enable = true; - pulse.enable = true; - jack.enable = true; - }; - xserver.xkb.layout = "se"; - displayManager = { - gdm.enable = true; - gdm.wayland = true; - }; - desktopManager.gnome.enable = true; - gnome = { - gnome-keyring.enable = true; - gnome-initial-setup.enable = false; - }; - }; # end services - - environment.gnome.excludePackages = with pkgs; [ - evolution - geary - gnome-contacts - gnome-music - gnome-user-docs - gnome-tour - gnome-weather - gnome-maps - gnome-calendar - gnome-initial-setup - gnome-clocks - ]; - - services.fwupd.enable = true; - programs = { - dconf.enable = true; - fish.enable = true; - steam = { - enable = true; - remotePlay.openFirewall = true; - }; - }; # end programs - - environment.systemPackages = with pkgs; [ - # CLI tools - git - wget - curl - btop - ripgrep - bat - fd - eza - bash - - # Chat - discord - signal-desktop - - # Browser - firefox - - # Development - vscode - devenv - direnv - - # Virtualization - podman - - # GNOME tweaks and extensions - gnome-tweaks - dconf-editor - gnomeExtensions.ddterm - - # Other - syncthing - steam - krita - edk2-uefi-shell - obsidian - ]; - environment.shells = with pkgs; [ fish ]; - - virtualisation.podman = { - enable = true; - dockerCompat = true; - defaultNetwork.settings.dns_enabled = true; - }; - - users.users.alisceon = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "podman" ]; - shell = pkgs.fish; - }; - -} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..7d41d9d --- /dev/null +++ b/shell.nix @@ -0,0 +1,14 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + name = "nixos_config"; + + buildInputs = with pkgs; [ + git + pre-commit + ]; + + shellHook = '' + echo "NixOS Config Shell" + ''; +} \ No newline at end of file