build(flake): switch to stable by default

Switch to using the stable version of nixpkgs but still use unstable
where it's needed.
This commit is contained in:
Oliver Davies 2023-08-03 22:59:10 +01:00
parent 8f4aa7bbfc
commit b68ad75ce3
6 changed files with 56 additions and 23 deletions

View file

@ -24,31 +24,32 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1691143977, "lastModified": 1687871164,
"narHash": "sha256-zXHmmghQdDLecVxFedRxSny4FtVH9lig1/BKObsHwfg=", "narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "15043a65915bcc16ad207d65b202659e4988066b", "rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1691006197, "lastModified": 1691065946,
"narHash": "sha256-DbtxVWPt+ZP5W0Usg7jAyTomIM//c3Jtfa59Ht7AV8s=", "narHash": "sha256-IVSh42Q3oJwUjgLKMdzH5fMx+fk1z3V735gK1Izj1Zw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "66aedfd010204949cb225cf749be08cb13ce1813", "rev": "e9ca92b55bed47696cc7cc25d3f854a1e2e01f86",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-unstable", "ref": "nixos-23.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -71,11 +72,28 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-unstable": {
"locked": {
"lastModified": 1691006197,
"narHash": "sha256-DbtxVWPt+ZP5W0Usg7jAyTomIM//c3Jtfa59Ht7AV8s=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "66aedfd010204949cb225cf749be08cb13ce1813",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
} }
} }
}, },

View file

@ -1,12 +1,22 @@
{ {
inputs = { inputs = {
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager/release-23.05";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
}; };
outputs = outputs =
inputs@{ flake-parts, home-manager, nixpkgs, self, ... }: inputs@{ flake-parts, home-manager, nixpkgs, nixpkgs-unstable, self, ... }:
let
system = "x86_64-linux";
specialArgs = {
pkgs-unstable = import nixpkgs-unstable {
inherit inputs system;
};
};
in
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
@ -19,14 +29,19 @@
flake = { flake = {
nixosConfigurations = { nixosConfigurations = {
nixedo = nixpkgs.lib.nixosSystem { nixedo = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = [ modules = [
./system/nixos/nixedo/configuration.nix ./system/nixos/nixedo/configuration.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager = {
home-manager.useUserPackages = true; extraSpecialArgs = specialArgs;
home-manager.users.opdavies = import ./home-manager/nixedo.nix; useGlobalPkgs = true;
useUserPackages = true;
users.opdavies = import ./home-manager/nixedo.nix;
};
} }
]; ];
}; };

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, pkgs-unstable, ... }:
let let
vim-astro = pkgs.vimUtils.buildVimPlugin { vim-astro = pkgs.vimUtils.buildVimPlugin {
@ -75,7 +75,7 @@ in
nixpkgs.config.allowUnfreePredicate = pkg: nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [ "postman" ]; builtins.elem (lib.getName pkg) [ "postman" ];
home.packages = (import ./home-manager-packages.nix) { inherit pkgs; }; home.packages = (import ./home-manager-packages.nix) { inherit pkgs pkgs-unstable; };
home.file."nodemon.json".text = '' home.file."nodemon.json".text = ''
{ {
@ -165,9 +165,9 @@ in
# LSP # LSP
vimPlugins.null-ls-nvim vimPlugins.null-ls-nvim
vimPlugins.nvim-lspconfig
vimPlugins.lsp-status-nvim vimPlugins.lsp-status-nvim
vimPlugins.lsp-zero-nvim pkgs-unstable.vimPlugins.lsp-zero-nvim
pkgs-unstable.vimPlugins.nvim-lspconfig
# Completion # Completion
vimPlugins.cmp-buffer vimPlugins.cmp-buffer
@ -212,7 +212,6 @@ in
# Language servers # Language servers
ansible-language-server ansible-language-server
lua53Packages.lua-lsp lua53Packages.lua-lsp
nixd
nodePackages.intelephense nodePackages.intelephense
nodePackages."@astrojs/language-server" nodePackages."@astrojs/language-server"
nodePackages."@tailwindcss/language-server" nodePackages."@tailwindcss/language-server"
@ -225,6 +224,7 @@ in
nodePackages.vue-language-server nodePackages.vue-language-server
nodePackages.yaml-language-server nodePackages.yaml-language-server
phpactor phpactor
pkgs-unstable.nixd
rnix-lsp rnix-lsp
terraform-ls terraform-ls

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, pkgs-unstable, ... }:
with pkgs; [ with pkgs; [
awscli2 awscli2
@ -35,13 +35,13 @@ with pkgs; [
php81Packages.phpcs php81Packages.phpcs
php81Packages.phpstan php81Packages.phpstan
pinentry pinentry
pkgs-unstable.rustywind
platformsh platformsh
postman postman
pulumi-bin pulumi-bin
pv pv
python3Full python3Full
ripgrep ripgrep
rustywind
terraform terraform
tldr tldr
tmuxinator tmuxinator

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, pkgs-unstable, ... }:
{ {
imports = [ imports = [

View file

@ -114,7 +114,7 @@ in
isNormalUser = true; isNormalUser = true;
description = "Oliver Davies"; description = "Oliver Davies";
extraGroups = [ "docker" "networkmanager" "wheel" ]; extraGroups = [ "docker" "networkmanager" "wheel" ];
packages = with pkgs; []; packages = with pkgs; [ ];
}; };
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;