made config work on nixos

This commit is contained in:
Natalie Marks 2025-05-28 08:31:42 -07:00
parent b9e231d72f
commit 800f63b000
No known key found for this signature in database
GPG key ID: 61F4EAEB0C9C3D5F
7 changed files with 605 additions and 690 deletions

View file

@ -50,22 +50,6 @@
} }
}, },
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1746162366,
"narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@ -81,7 +65,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1696426674,
@ -427,7 +411,7 @@
"nvf", "nvf",
"nixpkgs" "nixpkgs"
], ],
"rust-overlay": "rust-overlay_2" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1741118843, "lastModified": 1741118843,
@ -483,29 +467,6 @@
"type": "github" "type": "github"
} }
}, },
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1747826251,
"narHash": "sha256-Fe4AXmnnAKnh/wIe1ao4Pv/8m6WGA1ujwp6VApgos30=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "9a67b4a289cd8994080398d40b57cfde8e8cfb0a",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1736012469, "lastModified": 1736012469,
@ -537,22 +498,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": {
"locked": {
"lastModified": 1747676747,
"narHash": "sha256-LXkWBVqilgx7Pohwqu/ABxDVw+Cmi5/Mj2S2mpUH0Fw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "72841a4a8761d1aed92ef6169a636872c986c76d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1747744144, "lastModified": 1747744144,
@ -647,36 +592,14 @@
"nh": "nh", "nh": "nh",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-options-search": "nix-options-search", "nix-options-search": "nix-options-search",
"nixos-cosmic": "nixos-cosmic",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nvf": "nvf", "nvf": "nvf",
"rust-overlay": "rust-overlay_3", "rust-overlay": "rust-overlay_2",
"zig": "zig", "zig": "zig",
"zls": "zls" "zls": "zls"
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": {
"nixpkgs": [
"nixos-cosmic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1747795013,
"narHash": "sha256-c7i0xJ+xFhgjO9SWHYu5dF/7lq63RPDvwKAdjc6VCE4=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "6b1cf12374361859242a562e1933a7930649131a",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nvf", "nvf",
@ -698,7 +621,7 @@
"type": "github" "type": "github"
} }
}, },
"rust-overlay_3": { "rust-overlay_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -924,7 +847,7 @@
}, },
"zig": { "zig": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
@ -944,7 +867,7 @@
}, },
"zig-overlay": { "zig-overlay": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_7", "flake-utils": "flake-utils_7",
"nixpkgs": [ "nixpkgs": [
"zls", "zls",

222
flake.nix
View file

@ -29,9 +29,6 @@
moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly. moonlight.url = "github:moonlight-mod/moonlight"; # Add `/develop` to the flake URL to use nightly.
moonlight.inputs.nixpkgs.follows = "nixpkgs"; moonlight.inputs.nixpkgs.follows = "nixpkgs";
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
nixos-cosmic.inputs.nixpkgs.follows = "nixpkgs";
nh.url = "github:viperML/nh"; nh.url = "github:viperML/nh";
nh.inputs.nixpkgs.follows = "nixpkgs"; nh.inputs.nixpkgs.follows = "nixpkgs";
@ -40,80 +37,76 @@
nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = outputs = {
{ self,
self, nixpkgs,
nixpkgs, lix-module,
lix-module, darwin,
nixos-cosmic, ...
darwin, } @ inputs: let
... lib = nixpkgs.lib;
}@inputs: # TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere.
let overlays = [
lib = nixpkgs.lib; inputs.zig.overlays.default
# TODO: apply these overlays sooner and remove uses of legacyPackages elsewhere. inputs.rust-overlay.overlays.default
overlays = [ inputs.nh.overlays.default
inputs.zig.overlays.default
inputs.rust-overlay.overlays.default
inputs.nh.overlays.default
# https://github.com/LnL7/nix-darwin/issues/1041 # https://github.com/LnL7/nix-darwin/issues/1041
(_: prev: { (_: prev: {
karabiner-elements = prev.karabiner-elements.overrideAttrs (old: { karabiner-elements = prev.karabiner-elements.overrideAttrs (old: {
version = "14.13.0"; version = "14.13.0";
src = prev.fetchurl { src = prev.fetchurl {
inherit (old.src) url; inherit (old.src) url;
hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw="; hash = "sha256-gmJwoht/Tfm5qMecmq1N6PSAIfWOqsvuHU8VDJY8bLw=";
}; };
}); });
})
];
# Users of this flake currently use x86_64 Linux and Apple Silicon
systems = [
"x86_64-linux"
"aarch64-darwin"
];
forAllSystems = f:
builtins.listToAttrs (
builtins.map (system: {
name = system;
value = f (
inputs
// {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
}
);
}) })
]; systems
);
# Users of this flake currently use x86_64 Linux and Apple Silicon mkSystem = import ./lib/mkSystem.nix {
systems = [ inherit
"x86_64-linux" overlays
"aarch64-darwin" nixpkgs
]; lix-module
forAllSystems = inputs
f: mkNeovim
builtins.listToAttrs ( ;
builtins.map (system: { };
name = system; mkNeovim = import ./lib/mkNeovim.nix {
value = f ( inherit
inputs self
// { overlays
inherit system; nixpkgs
pkgs = nixpkgs.legacyPackages.${system}; inputs
} ;
); };
}) systems in rec {
); inherit self;
# "nix fmt"
mkSystem = import ./lib/mkSystem.nix { formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree);
inherit packages = forAllSystems (
overlays {system, ...}:
nixpkgs
lix-module
inputs
mkNeovim
;
};
mkNeovim = import ./lib/mkNeovim.nix {
inherit
self
overlays
nixpkgs
inputs
;
};
in
rec {
inherit self;
# "nix fmt"
formatter = forAllSystems (inputs: inputs.pkgs.nixfmt-tree);
packages = forAllSystems (
{ system, ... }:
{ {
nvim-chloe = mkNeovim "chloe" system; nvim-chloe = mkNeovim "chloe" system;
nvim-natalie = mkNeovim "natalie" system; nvim-natalie = mkNeovim "natalie" system;
@ -122,49 +115,46 @@
# "nix run .#darwin-rebuild" # "nix run .#darwin-rebuild"
darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild; darwin-rebuild = darwin.packages.aarch64-darwin.darwin-rebuild;
} }
); );
# natalie's desktop computer # natalie's desktop computer
nixosConfigurations.nixos = mkSystem "nixos" { nixosConfigurations.nixos = mkSystem "nixos" {
user = "natalie"; user = "natalie";
host = "desktop"; host = "desktop";
system = "x86_64-linux"; system = "x86_64-linux";
extraModules = [ extraModules = [
nixos-cosmic.nixosModules.default ];
];
};
# natalie's laptop
darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
user = "natalie";
host = "laptop";
system = "aarch64-darwin";
};
# chloe's mac studio "sandwich"
darwinConfigurations.sandwich = mkSystem "sandwich" {
user = "chloe";
host = "sandwich";
system = "aarch64-darwin";
};
# chloe's macbook air "paperback"
darwinConfigurations.paperback = mkSystem "paperback" {
user = "chloe";
host = "paperback";
system = "aarch64-darwin";
};
# generate checks for "nix flake check --all-systems --no-build"
checks.aarch64-darwin = builtins.listToAttrs (
builtins.map (
name:
let
d = darwinConfigurations.${name}.system;
in
{
name = "darwinConfiguration-" + d.name;
value = d;
}
) (builtins.attrNames darwinConfigurations)
);
}; };
# natalie's laptop
darwinConfigurations."Natalies-MacBook-Air" = mkSystem "Natalies-MacBook-Air" {
user = "natalie";
host = "laptop";
system = "aarch64-darwin";
};
# chloe's mac studio "sandwich"
darwinConfigurations.sandwich = mkSystem "sandwich" {
user = "chloe";
host = "sandwich";
system = "aarch64-darwin";
};
# chloe's macbook air "paperback"
darwinConfigurations.paperback = mkSystem "paperback" {
user = "chloe";
host = "paperback";
system = "aarch64-darwin";
};
# generate checks for "nix flake check --all-systems --no-build"
checks.aarch64-darwin = builtins.listToAttrs (
builtins.map (
name: let
d = darwinConfigurations.${name}.system;
in {
name = "darwinConfiguration-" + d.name;
value = d;
}
) (builtins.attrNames darwinConfigurations)
);
};
} }

View file

@ -8,14 +8,14 @@
host, host,
mainHomeImports, mainHomeImports,
... ...
}: }: let
let
cfg = config.programs; cfg = config.programs;
in in {
{ imports =
imports = mainHomeImports ++ [ mainHomeImports
./macos/sketchybar.nix ++ [
]; ./macos/sketchybar.nix
];
programs = { programs = {
home-manager.enable = true; home-manager.enable = true;
nix-index.enable = true; nix-index.enable = true;
@ -80,7 +80,7 @@ in
} }
]; ];
shellAliases = shellAliases =
{ } {}
// lib.optionalAttrs (!host.darwin) { // lib.optionalAttrs (!host.darwin) {
reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now"; reboot-windows = "sudo efibootmgr --bootnext 0000; sudo reboot -h now";
}; };

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: {pkgs, ...}: {
{
services = { services = {
avahi = { avahi = {
enable = true; enable = true;
@ -24,6 +23,7 @@
desktopManager.cosmic.enable = true; desktopManager.cosmic.enable = true;
displayManager.cosmic-greeter.enable = true; displayManager.cosmic-greeter.enable = true;
desktopManager.cosmic.xwayland.enable = true;
# Auto mount devices # Auto mount devices
udisks2 = { udisks2 = {
@ -40,7 +40,7 @@
# Enable CUPS to print documents. # Enable CUPS to print documents.
printing = { printing = {
enable = true; enable = true;
drivers = [ pkgs.brlaser ]; # Brother printer driver drivers = [pkgs.brlaser]; # Brother printer driver
}; };
pipewire = { pipewire = {
@ -55,7 +55,7 @@
openssh = { openssh = {
enable = true; enable = true;
ports = [ 22 ]; ports = [22];
settings = { settings = {
PasswordAuthentication = true; PasswordAuthentication = true;
UseDns = true; UseDns = true;

View file

@ -24,13 +24,11 @@
"https://cache.nixos.org/?priority=10" "https://cache.nixos.org/?priority=10"
"https://nix-community.cachix.org" "https://nix-community.cachix.org"
"https://cosmic.cachix.org/"
# For haskell # For haskell
"https://cache.iog.io" "https://cache.iog.io"
]; ];
trusted-public-keys = [ trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
# For haskell # For haskell
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
]; ];

View file

@ -3,8 +3,7 @@
user, user,
host, host,
... ...
}: }: {
{
imports = [ imports = [
# Include the results of the hardware scan. # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
@ -18,7 +17,7 @@
enable = true; enable = true;
# Certain features, including CLI integration and system authentication support, # Certain features, including CLI integration and system authentication support,
# require enabling PolKit integration on some desktop environments (e.g. Plasma). # require enabling PolKit integration on some desktop environments (e.g. Plasma).
polkitPolicyOwners = [ user.username ]; polkitPolicyOwners = [user.username];
}; };
noisetorch.enable = true; noisetorch.enable = true;
@ -35,7 +34,7 @@
steam = { steam = {
enable = true; enable = true;
package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; }; package = with pkgs; steam.override {extraPkgs = pkgs: [attr];};
}; };
git = { git = {
@ -59,7 +58,7 @@
xdg.portal = { xdg.portal = {
enable = true; enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; extraPortals = with pkgs; [xdg-desktop-portal-gtk];
}; };
virtualisation = { virtualisation = {
containers.enable = true; containers.enable = true;
@ -84,16 +83,14 @@
hybrid-sleep.enable = false; hybrid-sleep.enable = false;
}; };
packages = [ pkgs.observatory ]; services.monitord.wantedBy = ["multi-user.target"];
services.monitord.wantedBy = [ "multi-user.target" ];
}; };
i18n = { i18n = {
# Select internationalisation properties. # Select internationalisation properties.
defaultLocale = "en_US.UTF-8"; defaultLocale = "en_US.UTF-8";
supportedLocales = [ "all" ]; supportedLocales = ["all"];
extraLocaleSettings = { extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8"; LC_ADDRESS = "en_US.UTF-8";
@ -148,7 +145,10 @@
]; ];
}; };
environment = { environment = {
sessionVariables.COSMIC_DATA_CONTROL_ENABLED = 1; sessionVariables = {
COSMIC_DATA_CONTROL_ENABLED = 1;
NIXOS_OZONE_WL = "1";
};
variables.EDITOR = "nvim"; variables.EDITOR = "nvim";
systemPackages = with pkgs; [ systemPackages = with pkgs; [
@ -170,7 +170,7 @@
}; };
interfaces.enp11s0.wakeOnLan = { interfaces.enp11s0.wakeOnLan = {
enable = true; enable = true;
policy = [ "magic" ]; policy = ["magic"];
}; };
}; };