From 4ed81ce6e15f7e0cf119fbb5645f23498f9a6e20 Mon Sep 17 00:00:00 2001 From: Carsten Kragelund Date: Sat, 3 Jun 2023 11:42:15 +0200 Subject: [PATCH] formatting and stuff --- flake.lock | 16 +-- flake.nix | 201 ++++++++++++++++++--------------- hosts/common/default.nix | 17 ++- users/carsten/default.nix | 11 +- users/carsten/pkgs/default.nix | 104 +++++++++-------- users/default.nix | 12 ++ 6 files changed, 202 insertions(+), 159 deletions(-) create mode 100644 users/default.nix diff --git a/flake.lock b/flake.lock index 943ad38..fe4d573 100644 --- a/flake.lock +++ b/flake.lock @@ -151,16 +151,16 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1683475240, - "narHash": "sha256-sy6MYoCaIZsOenYplbzVXI4Ce9Bp/vIOpuFa97+a6wc=", + "lastModified": 1684481515, + "narHash": "sha256-sDMEZ4HLP6sVNiBcgla3KWihdDjh67DP5ZWkGKWFgY0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e040aab15638aaf8d0786894851a2b1ca09a7baf", + "rev": "5b1bc788f578cd83d54b48bb057d6f6703ae7725", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -200,11 +200,11 @@ ] }, "locked": { - "lastModified": 1684522262, - "narHash": "sha256-jLzI7Sdz+nbmw1bWwIzIjcZRBGJw6kXoDnXLkUSpYyg=", + "lastModified": 1684541278, + "narHash": "sha256-Uj3zSVFV690qMTtXvTK98JaL+lliUrP5bZ++to2naE8=", "ref": "refs/heads/main", - "rev": "a48a682a010b6aa0b9bfc51d64c591e83a53c042", - "revCount": 21, + "rev": "df04918245d3a0e630374d9eca162b844c18da5d", + "revCount": 23, "type": "git", "url": "https://gitea.pid1.sh/sanctureplicum/nur.git" }, diff --git a/flake.nix b/flake.nix index 6011b1f..a6c6ef8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { nixpkgs.url = "nixpkgs/nixos-22.11"; - nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nur.url = "github:nix-community/nur"; sanctureplicum-nur = { url = "git+https://gitea.pid1.sh/sanctureplicum/nur.git"; @@ -32,100 +32,123 @@ }; }; - outputs = - { self - , nixpkgs - , nixpkgs-unstable - , nur - , sanctureplicum-nur - , nekowinston-nur - , emacs-overlay - , nixos-wsl - , sops-nix - , home-manager - , ... - } @inputs: - let - overlays = [ - (import emacs-overlay) - (final: prev: let unstable = import nixpkgs-unstable { - system = prev.system; - config.allowUnfree = true; - }; in { - nur = import nur { - nurpkgs = unstable; - pkgs = unstable; - repoOverrides = { - nekowinston = import nekowinston-nur { pkgs = unstable; }; - sanctureplicum = import sanctureplicum-nur { pkgs = unstable; system = unstable.system; }; + outputs = { + self, + nixpkgs, + nixpkgs-unstable, + nur, + sanctureplicum-nur, + nekowinston-nur, + emacs-overlay, + nixos-wsl, + sops-nix, + home-manager, + ... + } @ inputs: let + overlays = [ + (import emacs-overlay) + (final: prev: let + unstable = import nixpkgs-unstable { + system = prev.system; + config.allowUnfree = true; + }; + in { + nur = import nur { + nurpkgs = unstable; + pkgs = unstable; + repoOverrides = { + nekowinston = import nekowinston-nur {pkgs = unstable;}; + sanctureplicum = import sanctureplicum-nur { + pkgs = unstable; + system = unstable.system; }; }; - inherit unstable; + }; + inherit unstable; + }) + ]; + in { + nixosConfigurations.falcon = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ({ + config, + pkgs, + ... + }: { + nixpkgs.overlays = overlays; }) + + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.backupFileExtension = "bak"; + } + ./hosts/falcon ]; - in { - nixosConfigurations.falcon = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ({ config, pkgs, ... }: { - nixpkgs.overlays = overlays; - }) + }; + nixosConfigurations.eagle = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ({ + config, + pkgs, + ... + }: { + nixpkgs.overlays = overlays; + }) - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "bak"; - } - ./hosts/falcon - ]; - }; - nixosConfigurations.eagle = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ({ config, pkgs, ... }: { - nixpkgs.overlays = overlays; - }) + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.backupFileExtension = "bak"; + home-manager.sharedModules = [ + sops-nix.homeManagerModule + ]; + } + ./hosts/eagle + ]; + }; + nixosConfigurations.buzzard = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ({ + config, + pkgs, + ... + }: { + nixpkgs.overlays = overlays; + }) - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "bak"; - home-manager.sharedModules = [ - sops-nix.homeManagerModule - ]; - } - ./hosts/eagle - ]; - }; - nixosConfigurations.buzzard = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ({ config, pkgs, ... }: { - nixpkgs.overlays = overlays; - }) - - nixos-wsl.nixosModules.wsl - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "bak"; - } - ./hosts/buzzard - ]; - }; - nixosConfigurations.gitea = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ({ config, pkgs, ... }: { - nixpkgs.overlays = overlays; - }) + nixos-wsl.nixosModules.wsl + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.backupFileExtension = "bak"; + home-manager.sharedModules = [ + (import ./powershell.nix) + ]; + } + ./hosts/buzzard + ]; + }; + nixosConfigurations.gitea = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ({ + config, + pkgs, + ... + }: { + nixpkgs.overlays = overlays; + }) - sops-nix.nixosModules.sops - ./hosts/gitea - ]; - }; + sops-nix.nixosModules.sops + ./hosts/gitea + ]; }; + }; } diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 6098ead..f26f642 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,12 +1,12 @@ -{ config -, lib -, pkgs -, ... +{ + config, + lib, + pkgs, + ... }: with config; with lib; -with pkgs; -{ +with pkgs; { imports = [ ./graphical.nix ./vm-guest.nix @@ -26,7 +26,6 @@ with pkgs; }; }; - # Enable non-free packages nixpkgs.config.allowUnfree = true; @@ -43,9 +42,9 @@ with pkgs; sandbox = true; # Enable flakes - experimental-features = [ "nix-command" "flakes" ]; + experimental-features = ["nix-command" "flakes"]; - trusted-users = [ config.users.users.carsten.name or "" ]; + trusted-users = [config.users.users.carsten.name or ""]; substituters = [ "https://nix-community.cachix.org" diff --git a/users/carsten/default.nix b/users/carsten/default.nix index 28ed1b2..eaa8395 100644 --- a/users/carsten/default.nix +++ b/users/carsten/default.nix @@ -1,8 +1,9 @@ -{ config -, pkgs -, ... +{ + config, + pkgs, + ... }: { - imports = [ ]; + imports = []; users.users.carsten = { isNormalUser = true; @@ -15,7 +16,7 @@ "docker" # Containers ]; shell = pkgs.bash; - packages = [ ]; + packages = []; }; home-manager.users.carsten = { diff --git a/users/carsten/pkgs/default.nix b/users/carsten/pkgs/default.nix index e098ac5..c6ccdcf 100644 --- a/users/carsten/pkgs/default.nix +++ b/users/carsten/pkgs/default.nix @@ -1,64 +1,72 @@ -{ pkgs, config, osConfig, lib, ... }: { +{ + pkgs, + config, + osConfig, + lib, + ... +}: { imports = [ ./firefox.nix ./gpg.nix ./editors.nix ]; - programs.bash.enable = true; + programs.bash.enable = builtins.trace config.home.profileDirectory true; services.lorri.enable = true; - home.packages = with pkgs; [ - (ripgrep.override { withPCRE2 = true; }) - direnv - dogdns - duf - exa - fd - jq - mcfly - (if osConfig.graphical then - pinentry-gtk2 - else - pinentry-curses) - unzip - yq - wezterm + home.packages = with pkgs; + [ + (ripgrep.override {withPCRE2 = true;}) + direnv + dogdns + duf + exa + fd + jq + mcfly + ( + if osConfig.graphical + then pinentry-gtk2 + else pinentry-curses + ) + unzip + yq + wezterm + # Rust + cargo + gcc + llvmPackages_latest.lld + llvmPackages_latest.llvm + rustc - # Rust - cargo - gcc - llvmPackages_latest.lld - llvmPackages_latest.llvm - rustc + # JS + nodejs + nodePackages.npm - # JS - nodejs - nodePackages.npm + # Music + mpc-cli - # Music - mpc-cli + # language-servers + rust-analyzer + ] + ++ lib.lists.optionals osConfig.graphical [ + (discord.override {withOpenASAR = true;}) + catppuccin-gtk + dconf + gparted + numberstation + pavucontrol + recursive + wireplumber + # Local + (callPackage ./areon-pro {}) - # language-servers - rust-analyzer - ] ++ lib.lists.optionals osConfig.graphical [ - (discord.override { withOpenASAR = true; }) - catppuccin-gtk - dconf - gparted - numberstation - pavucontrol - recursive - wireplumber - # Local - (callPackage ./areon-pro {}) - - pkgs.nur.repos.sanctureplicum.rec-mono-nyx + pkgs.nur.repos.sanctureplicum.rec-mono-nyx - gnomeExtensions.color-picker - gnomeExtensions.just-perfection - gnomeExtensions.unite - ]; + gnomeExtensions.color-picker + gnomeExtensions.just-perfection + gnomeExtensions.unite + ]; } diff --git a/users/default.nix b/users/default.nix new file mode 100644 index 0000000..f5494ce --- /dev/null +++ b/users/default.nix @@ -0,0 +1,12 @@ +{ ... }: { + carsten = { + fullName = "Carsten Kragelund"; + hashedPassword = "$y$j9T$oL/jNqI1yz65OuUnJvpCn1$MC7.xSyvprru7QmqQVsGyBKZf2b4w7R7U.TmfzSBY39"; + groups = [ + "networkmanager" # Use networks + "wheel" # Sudoer + "vboxusers" # VirtualBox + "docker" # Containers + ]; + } +} \ No newline at end of file