initial setup for home-manager on darwin

This commit is contained in:
Adithya 2023-06-10 13:27:44 +05:30
parent eec7f91843
commit 5524721426
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
4 changed files with 65 additions and 9 deletions

View file

@ -33,6 +33,27 @@
"type": "github"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1686210161,
"narHash": "sha256-cgP8P2Gk4WtOzd/Y7nEmweLpPOtMKVvHCIcq9zm9qMk=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "40e4b85baac86969f94d6dba893aeae015c562c1",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -289,6 +310,7 @@
},
"root": {
"inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"impermanence": "impermanence",
"lanzaboote": "lanzaboote",

View file

@ -6,6 +6,9 @@
url = "github:NixOS/nixpkgs/nixos-unstable";
};
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@ -29,20 +32,24 @@
outputs = {
self,
nixpkgs,
darwin,
home-manager,
impermanence,
lanzaboote,
nixneovimplugins,
} @ inputs: {
formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".alejandra;
nixosConfigurations = let
} @ inputs: let
user = (import ./secrets.nix).users;
in {
formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".alejandra;
formatter."x86_64-darwin" = nixpkgs.legacyPackages."x86_64-darwin".alejandra;
nixosConfigurations = {
Skipper = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {allowUnfree = true;};
config = {
allowUnfree = true;
};
overlays = [(import ./packages) nixneovimplugins.overlays.default];
};
specialArgs = inputs;
@ -76,7 +83,9 @@
system = "aarch64-linux";
pkgs = import nixpkgs {
inherit system;
config = {allowUnfree = true;};
config = {
allowUnfree = true;
};
};
specialArgs = inputs;
modules = [
@ -88,5 +97,20 @@
];
};
};
homeConfigurations."${user.primary.userName}@Alex" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-darwin";
config = {
allowUnfree = true;
};
overlays = [nixneovimplugins.overlays.default];
};
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [
(import ./home/darwin.nix {inherit user;})
];
};
};
}

10
home/darwin.nix Normal file
View file

@ -0,0 +1,10 @@
{user, ...}: {
home = {
username = user.primary.userName;
homeDirectory = "/Users/${user.primary.userName}";
stateVersion = "23.11";
};
programs.home-manager.enable = true;
imports = [./programs/neovim.nix];
}

View file

@ -1,7 +1,7 @@
{pkgs, ...}: {
xdg.desktopEntries."nvim".name = "Neovim wrapper";
xdg.desktopEntries."nvim".exec = "nvim %F";
xdg.desktopEntries."nvim".noDisplay = true;
#xdg.desktopEntries."nvim".name = "Neovim wrapper";
#xdg.desktopEntries."nvim".exec = "nvim %F";
#xdg.desktopEntries."nvim".noDisplay = true;
programs.neovim = {
enable = true;