diff --git a/common/base/hardware.nix b/common/base/hardware.nix index 2cd7e9c..88af726 100644 --- a/common/base/hardware.nix +++ b/common/base/hardware.nix @@ -1,13 +1,13 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { boot = { - tmp.useTmpfs = true; - initrd.systemd.enable = true; + tmp.useTmpfs = lib.mkDefault true; + initrd.systemd.enable = lib.mkDefault true; }; system.etc.overlay = { - enable = true; + enable = lib.mkDefault true; # mutable = false; # TODO: broken by nixpkgs#328926 diff --git a/common/base/users.nix b/common/base/users.nix index 3375933..30f3c51 100644 --- a/common/base/users.nix +++ b/common/base/users.nix @@ -43,7 +43,7 @@ }; users.root = { - initialHashedPassword = passwdHash; + initialHashedPassword = lib.mkDefault passwdHash; openssh.authorizedKeys.keys = [ sshPubKey ]; }; }; diff --git a/common/impermanent/home.nix b/common/impermanent/home.nix index 6723b72..e2e677e 100644 --- a/common/impermanent/home.nix +++ b/common/impermanent/home.nix @@ -23,6 +23,7 @@ ".config/discord" ".config/easyeffects" ".config/keepassxc" + ".config/github-copilot" ".config/Logseq" ".logseq" diff --git a/flake.lock b/flake.lock index 16aa06f..57ed382 100644 --- a/flake.lock +++ b/flake.lock @@ -32,6 +32,22 @@ "type": "gitlab" } }, + "copilot-lualine": { + "flake": false, + "locked": { + "lastModified": 1725375487, + "narHash": "sha256-PXiJ7rdlE8J93TFtu+D+8398Wg7DhK7EZ0Aw4JDoqWM=", + "owner": "AndreM222", + "repo": "copilot-lualine", + "rev": "f40450c3e138766026327e7807877ea860618258", + "type": "github" + }, + "original": { + "owner": "AndreM222", + "repo": "copilot-lualine", + "type": "github" + } + }, "easyeffects-presets": { "flake": false, "locked": { @@ -471,7 +487,9 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-docs": "nixpkgs-docs", + "nixpkgs-docs": [ + "nixpkgs" + ], "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", "nmd": "nmd" }, @@ -507,6 +525,29 @@ "type": "github" } }, + "nixos-generators": { + "inputs": { + "nixlib": [ + "nixpkgs" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1725497951, + "narHash": "sha256-fayKyVs/9FQdYH+3SCOkQM1GCsEPPVE+lSiVGlYQ7i0=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "15a07ebf4a041bf232026263f1f96f2af390f3bc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1724878143, @@ -537,22 +578,6 @@ "type": "github" } }, - "nixpkgs-docs": { - "locked": { - "lastModified": 1705957679, - "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-for-bootstrap": { "locked": { "lastModified": 1720244366, @@ -738,6 +763,7 @@ }, "root": { "inputs": { + "copilot-lualine": "copilot-lualine", "easyeffects-presets": "easyeffects-presets", "flake-compat": "flake-compat", "flake-parts": "flake-parts", @@ -753,6 +779,7 @@ "nix-colors": "nix-colors", "nix-on-droid": "nix-on-droid", "nix-prelude": "nix-prelude", + "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", "nixpkgs-master": "nixpkgs-master", diff --git a/flake.nix b/flake.nix index 8a66400..3cc7809 100644 --- a/flake.nix +++ b/flake.nix @@ -26,10 +26,11 @@ # android - nix-on-droid = { - url = github:nix-community/nix-on-droid; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.home-manager.follows = "home-manager"; + nix-on-droid.url = github:nix-community/nix-on-droid; + nix-on-droid.inputs = { + nixpkgs.follows = "nixpkgs"; + nixpkgs-docs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; }; # modules @@ -38,6 +39,12 @@ impermanence.url = github:nix-community/impermanence; intransience.url = github:anna328p/intransience; + nixos-generators.url = github:nix-community/nixos-generators; + nixos-generators.inputs = { + nixpkgs.follows = "nixpkgs"; + nixlib.follows = "nixpkgs"; + }; + nix-colors.url = github:misterio77/nix-colors; nix-colors.inputs.nixpkgs-lib.follows = "nixpkgs"; @@ -46,25 +53,20 @@ qbot.url = github:arch-community/qbot; - snm = { - url = gitlab:simple-nixos-mailserver/nixos-mailserver; - inputs = { - nixpkgs.follows = "nixpkgs"; - nixpkgs-24_05.follows = "nixpkgs"; - flake-compat.follows = "flake-compat"; - }; + snm.url = gitlab:simple-nixos-mailserver/nixos-mailserver; + snm.inputs = { + nixpkgs.follows = "nixpkgs"; + nixpkgs-24_05.follows = "nixpkgs"; + flake-compat.follows = "flake-compat"; }; # packages - neovim-nightly-overlay = { - url = github:nix-community/neovim-nightly-overlay; - - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-parts.follows = "flake-parts"; - flake-compat.follows = "flake-compat"; - }; + neovim-nightly-overlay.url = github:nix-community/neovim-nightly-overlay; + neovim-nightly-overlay.inputs = { + nixpkgs.follows = "nixpkgs"; + flake-parts.follows = "flake-parts"; + flake-compat.follows = "flake-compat"; }; nil.url = github:oxalica/nil; @@ -85,6 +87,9 @@ nvim-treesitter.url = github:nvim-treesitter/nvim-treesitter; nvim-treesitter.flake = false; + copilot-lualine.url = github:AndreM222/copilot-lualine; + copilot-lualine.flake = false; + easyeffects-presets.url = github:digitalone1/easyeffects-presets; easyeffects-presets.flake = false; @@ -112,9 +117,10 @@ , nil , nix-prelude , nix-on-droid + , nixos-generators , ... }@flakes: let - localPkgs = import ./pkgs flakes; + localPkgs = import ./pkgs { inherit flakes; }; ## # Module paths @@ -150,6 +156,8 @@ angelia = systems/angelia; heracles = systems/heracles; iris = systems/iris; + + iso = systems/iso; }; }; @@ -260,7 +268,11 @@ overlays = [ self.overlays.default ]; }; in - localPkgs.mkPackageSet pkgs + (localPkgs.mkPackageSet pkgs) + // { + iso-x86_64 = import ./images/iso-x86_64 + { inherit pkgs flakes specialArgs; }; + } ); }; } \ No newline at end of file diff --git a/home/workstation/editor.nix b/home/workstation/editor.nix index 2d653bd..d03ad74 100644 --- a/home/workstation/editor.nix +++ b/home/workstation/editor.nix @@ -163,11 +163,15 @@ (CallFrom (Require "gitsigns") "setup" { }) ]) { }) + v.copilot-lualine + (luaPlugin v.lualine-nvim (Code [ (CallFrom (Require "lualine") "setup" { options = { icons_enabled = false; theme = "base16"; + + sections.lualine_y = [ "copilot" "progress" ]; }; }) ]) { }) @@ -268,9 +272,9 @@ gemCmd = exe: test: args: [ "bash" "-c" - ("bundle exec steep --version" - + " && exec bundle exec steep langserver" - + " || exec steep langserver") + ("bundle exec ${exe} ${test}" + + " && exec bundle exec ${exe} ${args}" + + " || exec ${exe} ${args}") ]; rubyLS = name: cmd: extra: @@ -314,6 +318,7 @@ single_file_support = true; }) + # make nil-ls a semanticTokensProvider (Call [ "LspAttach" { callback = Function ({ args }: [ (SetLocal @@ -328,6 +333,10 @@ "semanticTokensProvider" ]) null) ])]); } ]) + + # code action keybind to alt+enter + (Call [ "n" "" + ]) ]) { }) (let diff --git a/images/iso-x86_64/default.nix b/images/iso-x86_64/default.nix new file mode 100644 index 0000000..756db93 --- /dev/null +++ b/images/iso-x86_64/default.nix @@ -0,0 +1,13 @@ +{ flakes, specialArgs, ... }: + +flakes.nixos-generators.nixosGenerate { + system = "x86_64-linux"; + + modules = [ + ../../systems/iso + ]; + + inherit specialArgs; + + format = "install-iso"; +} \ No newline at end of file diff --git a/pkgs/all-packages.nix b/pkgs/all-packages.nix index 212750e..5475e99 100644 --- a/pkgs/all-packages.nix +++ b/pkgs/all-packages.nix @@ -10,4 +10,6 @@ in { keydb = callPackage' ./keydb { }; neovim-ruby-env = callPackage' ./neovim-ruby-env { }; + + iso-x86_64 = callPackage' ./iso-x86_64 { }; } \ No newline at end of file diff --git a/pkgs/default.nix b/pkgs/default.nix index 378ce57..3195e0d 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,6 +1,8 @@ -{ nixpkgs, ... }@flakes: +{ flakes }: let + inherit (flakes) nixpkgs; + truncateRev = builtins.substring 0 7; mkFlakeVer = flake: prefix: diff --git a/pkgs/overlays/vim/default.nix b/pkgs/overlays/vim/default.nix index 4a7b92d..027b751 100644 --- a/pkgs/overlays/vim/default.nix +++ b/pkgs/overlays/vim/default.nix @@ -37,5 +37,6 @@ in { } // buildPluginsFrom flakes [ "vim-slim" "rainbow-delimiters-nvim" + "copilot-lualine" ]); } \ No newline at end of file diff --git a/systems/iso/default.nix b/systems/iso/default.nix new file mode 100644 index 0000000..6333ae8 --- /dev/null +++ b/systems/iso/default.nix @@ -0,0 +1,21 @@ +{ localModules, ... }: + +{ + imports = let + inherit (localModules) common; + in [ + common.base + common.physical + ]; + + networking.hostName = "nixos-iso"; + + services.openssh.enable = true; + + misc.uuid = "b210a256-c9d0-4c44-a658-28ce6fe204b7"; + + boot.initrd.systemd.enable = false; + system.etc.overlay.enable = false; + + time.timeZone = "Etc/UTC"; +} \ No newline at end of file